Skip to content

eddietex/PredictiveParsing

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

1 Commit
 
 
 
 

Repository files navigation

Predictive Parsing

Converts infix notation single-digit operations to postfix notation using predictive parsing.

  • Example of valid expression: 1+3/4%3+(2-1)
  • Example of invalid expression: 1+23/3

College project for Programming Languages Class

Reference:

Grammar used:

  • expr → operation rest
  • rest → + operation {print (‘+’)} rest | - operation {print (‘-’)} rest | ε
  • operation → operand rest2
  • rest2 → * operand {print (‘*’)} rest2 | / operand {print (‘/’)} rest2 | ε
  • operand → factor rest3
  • rest3 → % factor {print (‘*’)} | ε
  • factor → digit | ( expr )
  • digit → 0 {print(‘0’)} (where 0 can be any digit from 0 to 9)

About

SOSU CS4323 Predictive Parsing Project

Resources

Stars

Watchers

Forks

Releases

No releases published

Packages

No packages published

Languages