I built a parser in JavaCC that given for example: let a : int =5+4; it displays:
Start
Sxl
Statement
VariableDecl
Identifier
Type
Expression
SimpleExpression
Term
Factor
Literal
IntegerLiteral
AdditiveOp
Term
Factor
Literal
IntegerLiteral
Parsed.
that works fine however I need enhance this parser to output to an xml file and output the following output for the above input:
letNode( Identier(X), ExprNode( PlusNode( IntegerLiteral(8), IntegerLiteral(2) )))
How can this be done, do I need to use normal Java or there is some functionality in JavaCC?