LAnguage eXample (LAX) is a basic programming language given for the purpose of studying Compilers (here Lexical and Syntax Analysis). It is stated in the Waitegoose book.
Link for the same is given here
Using regular expressions, we identify the tokens first, then categorise them. This can be seen in lexer.l file. We perform this using Lex language.
Using LR-parser technique, we perform this part. We take the categorised tokens and build an LR-parser (Bottom-Top tree). If we can build the whole tree, then parsing is successful, else there is an error. This can be observed in parser.y file, using Yacc.
open the current dir in terminal
follow these instructions then:
1.chmod +x run.sh
2../run.sh
It is to be noted that the lex file tokenises the program in "input.txt" written in LAX(LAnguage eXample) language and the yacc file parses it, if any error is found in the input file, parsing is stopped with an error.
For more information on states, Action and Goto elements of the parser, y.output file is to be get in reference with.