Now we have to specify the syntactic structure of mjava well-formed programs.
By means of Cup, we’ll then transform the parser specification (grammar, conflict resolution directives, ...) into a Java program implementing an LALR parser.
The parser specification of the mjava language is reported in the mjava.cup file, that uses the scanner generated by mjava.flex to perform lexical analysis and then generates the interface sym.java and the parser mjavac.java.
We have slightly modified the previous version of mjava.flex, by introducing the class JavaSymbol.java to retrieve more detailed information about lexical tokens.
· you will get something like SampleProgramParsingResult.txt printed to your Java console.