OlejnikDenis / LexicalAnalyzer

Lexer and Parser for Pascal syntax (PascalABC)

Geek Repo:Geek Repo

Github PK Tool:Github PK Tool

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

About

Lexer and Parser for Pascal syntax (PascalABC)


Languages

Language:C# 100.0%