Question: python help. need to create this program Language for propositional language In this homework you are to implement lexer and parser for a simple language.

python help. need to create this program

python help. need to create this program Language for propositional language In

Language for propositional language In this homework you are to implement lexer and parser for a simple language. Token definitions: ID = [A-Z]+ LAPR = ( RPAR-) NOT! AND = N OR=V IMPLIES Grammar propositions proposition more-proposition more-proposition-) , propositions roposition - atomic | compound atomic 0 | 1 | ID compound - atomic connective proposition | LPAR proposition RPAR NOT proposition connective AND | OR IMPLIES | IFF The start variable is propositions. Your implementation should receive a file, if the input file is a valid program, it should print the parse tree in prefix order, otherwise it should return "Syntax Error" message along with the line and column numbers of the first error. Instructions: Use Python 2.7 for implementation Language for propositional language In this homework you are to implement lexer and parser for a simple language. Token definitions: ID = [A-Z]+ LAPR = ( RPAR-) NOT! AND = N OR=V IMPLIES Grammar propositions proposition more-proposition more-proposition-) , propositions roposition - atomic | compound atomic 0 | 1 | ID compound - atomic connective proposition | LPAR proposition RPAR NOT proposition connective AND | OR IMPLIES | IFF The start variable is propositions. Your implementation should receive a file, if the input file is a valid program, it should print the parse tree in prefix order, otherwise it should return "Syntax Error" message along with the line and column numbers of the first error. Instructions: Use Python 2.7 for implementation

Step by Step Solution

There are 3 Steps involved in it

1 Expert Approved Answer
Step: 1 Unlock blur-text-image
Question Has Been Solved by an Expert!

Get step-by-step solutions from verified subject matter experts

Step: 2 Unlock
Step: 3 Unlock

Students Have Also Explored These Related Databases Questions!