Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Node as nonterminal name #3

Open
jonyrock opened this issue Sep 11, 2013 · 1 comment
Open

Node as nonterminal name #3

jonyrock opened this issue Sep 11, 2013 · 1 comment
Assignees

Comments

@jonyrock
Copy link

Lets consider a .tm file

language prop(java);

prefix = "AST"
package = "ru.aptu.xml"
gentree=true
genast=true
positions="offset, line"
endpositions="offset"

:: lexer

identifier(String): /[a-zA-Z_][a-zA-Z_0-9]*/   { $symbol = current(); }
openChar:       /</
closeChar:      />/
_skip:          /[\n\t\r ]+/ (space)

:: parser

input ::= root=node;
node ::= openChar identifier closeChar;

This compiles successfully without any warning but leads to a semantically wrong program. In /ast/AstNode we will get

public class AstNode extends AstNode {
}
@ghost ghost assigned inspirer Sep 12, 2013
mewmew added a commit to mewspring/foo that referenced this issue Nov 3, 2018
@mewmew
Copy link
Contributor

mewmew commented Nov 3, 2018

It looks as though this issue has been resolved.

Given the grammar a.tm, the output is ast/Ast_Node.java:

public class Ast_Node extends AstNode {

As such. Feel free to close this issue.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

3 participants