Skip to content

mohamad-khorsandi/python-syntax-analyzer

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

10 Commits
 
 
 
 
 
 
 
 
 
 
 
 
 
 

Repository files navigation

python syntax analyzer

this is a simple python syntax analyzer for educational purposes. the project can detect syntax mistakes in code and suggests for correction.

grammar files

it contains several files for syntax inside grammar_src directory. you can add syntax even for other languages as you wish. syntax files are at BNF form. this is an example of these syntax files:

Screenshot 2025-08-16 173841

code file

also there is a file for input python code: the file is inside pyCode directory.

test

let's test it with a wrong code:

Screenshot 2025-08-16 180024

this code missed a colon at line 16. now this is the result:
Screenshot 2025-08-16 180226

About

detecting python syntax errors given attribute grammar in BNF form

Topics

Resources

Stars

Watchers

Forks

Languages