Skip to content

Lexer and Parser for Pascal syntax (PascalABC)

Notifications You must be signed in to change notification settings

DenisOlejnik/LexicalAnalyzer

Repository files navigation

Lexical analyzer

The program implements lexical and syntactic parsers. The program is written for code that is very similar to Pascal (PascalABC).

Implemented features

  • Lexical analyzer
  • Syntax analyzer
  • Basic error search (Unknown type/value)

Implemented lexems

  • Variable ("true" and "true1" are different)
  • States (true, false)
  • Separators (';' does not equal ':')

Not implemented:

  • Search for errors in the logic or spelling of lexemes
  • Floating point number detection
  • Arrays []
  • Loops (for, while, etc)
  • A lot of other things.

Screenshots

Program startup

Source file example

Lexical table example

Syntax tree example

Error example

This abstract syntax tree is based on the file \Samples\Sample 2.txt Abstract syntax tree for Sample code #1

License

MIT