I need a program to read the language from a file and tell if the syntax is correct but also show if there is an error and specify it with line:column and what's wrong.
Language Specification:
Data Types:
pint = integer
pchar = char
pfloat = float
pdouble = double
if statements with the name of "pif"
for and while loops with the names "pfor and pwhile"
printf and scanf methods
arithmetic validations
all opening/closing tokens must be a lowercase "p"
all variable names must start with a uppercase "P"
there is no need to generate an executable, only the lexer/parser with error handling and correction suggestion
code example:
pint number = 10;
pif p number < 20 p
p
printf p "20 is bigger than " + number p;
p
the code above is a valid example, if it was missing a semicolon for example it would have to show there was an error in line X and Column X and it was expecting a semicolon but found X
You can use flex, bison, antlr or whatever lib or language you prefer.
Hi sir i did a same project like this that was online compiler and I can do it again for syntax check for you ... I can do it in max 1-2 day or min in 12 hours thanks have a good day ...
I am a skilled UNIX/Linux developer with a lot of experience (started to work with C/C++ more than 20 years ago). I spent many years of my career as a university teacher. My main subjects were “C and C++ programming” and “operating systems” where I used UNIX/Linux in practical education. I also wrote several books on these subjects.