Hi,
I have a question about the AST, for example I have the following grammar:
var @Identifier = new Terminal("Identifier");
// Some other Terminals
var typeSpec = new NonTerminal("TypeSpecifiers");
var funcDef = new NonTerminal("FunctionDefinition");
var declarator = new NonTerminal("Declarator");
var paraList = new NonTerminal("ParameterList");
var block = new NonTerminal("Block");
// Some other NonTerminals
funcDef.Production = typeSpec + declarator + block["funcBlock"]
> Ast<FunctionDefinition>()
.SetProperty(x => x.Block, AstFrom("funcBlock"))
.SetProperty(x => x.Name, ???)
.SetProperty(x => x.ParameterList, ???);
declarator.Production = (XXXX | @Identifier) + (paraList | XXXXX) | (XXXX).....
The "FunctionDefinition" is a type-specific ast node type, and have some properties, I want to set the "@Identifier"(in the "declarator") to the "Name" property, and set the "paraList " to the "ParameterList" property...
I do not want to refactor the grammar.
How to do it ?
Thanks a lot!