hellcoderz/lexical-analyser
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Folders and files
Name | Name | Last commit message | Last commit date | |
---|---|---|---|---|
Repository files navigation
To use just enter > python calc.py Tested with Python 2.7 Calculator Grammar <statement> → <command> | <expr> | id | id = <expr> <command> → ‘list’ | ‘clear’ | ‘exit’ | ‘quit’ <expr> → <expr> ‘+’ <term> | <expr> ‘-‘ <term> | <term> <term> → <term> ‘*’ <factor> | <term> ‘/’ <factor> | <factor> <factor> → <unary_op> <base> <exponent> <unary_op> → ‘+’ | ‘-‘ | ε <base> → ( <expr> ) | id | int_number | real_number <exponent> → ‘^’ <factor> | ε Terminal symbols id = <alpha> (<alpha>|<digit>)* int_number = <digit>+ real_number = (<digit> ‘.’ | ‘.’ <digit>) <number>* [ (‘e’|’E’) [‘+’|’-‘] <digit>+ ] <alpha>: A-Z a-z _ [ x ] means x is optional <digit>: 0-9
About
A python lexical analyser dur for a "Principles of Programming Languages" assignment.
Resources
Stars
Watchers
Forks
Releases
No releases published
Packages 0
No packages published