textmapper
textmapper copied to clipboard
Node as nonterminal name
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 {
}
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.