Currently, It supports identifiers and basic + and - arithmetic operation parsing.
Changes
AST and Parser library add supports to identifier and basic + and - arithmetic operation parsing
Include AST directory to root CMakeFile file
Make the main function return Parsed result (Previously returned Lexed result)
./AParser
>>> 1+2
ProgramStatement {
BinaryExpression (Left Value : IntegerExpression (Value : 1), Op Value : +, Right Value : IntegerExpression (Value : 2), )
}
>>> 1+3+52+92+1
ProgramStatement {
BinaryExpression (Left Value : BinaryExpression (Left Value : BinaryExpression (Left Value : BinaryExpression (Left Value : IntegerExpression (Value : 1), Op Value : +, Right Value : IntegerExpression (Value : 3), ), Op Value : +, Right Value : IntegerExpression (Value : 52), ), Op Value : +, Right Value : IntegerExpression (Value : 92), ), Op Value : +, Right Value : IntegerExpression (Value : 1), )
}
>>>
Currently, It supports identifiers and basic + and - arithmetic operation parsing.
Changes