Building a recognizer
This is your third module for your Designer Programming Language assignment.
You may develop your code
any of the allowed procedural language,
but you must ensure it runs correctly under Linux
Your task is to write a recognizer for your language.
recognizer is like a souped-up scanner; additionally,
whether or not the
lexemes are in the proper order.
One builds a recognizer by implementing a grammar.
Recursive Descent Parsing
Once you have developed a grammar for your language,
the next task is to
build a recognizer for your language via recursive descent parsing.
recognizer is a program which says whether the expressions (sentences)
in your source code are syntactically legal.
A parser is an
implementation of a grammar.
A recursive descent parser is a parser
composed of a set of parsing functions,
each of which derives from a
rule in the grammar.
It should become apparent why the appellation
recursive descent is used to describe parsers built in
this fashion. Begin by reading
Coding standards are as before.
you are to write a recognizer for your language.
You should complete your grammar
implement an appropriate recognizer.
One should be able to run the recognizer on a file
consisting of a single program by
typing in the command:
FFFF is the name of the file to be
The output of the program should be the string "legal"
In the case of an illegal expression,
generated by match should be displayed prior to the
output of the program.
For testing purposes, have the match error be printed to
stdout. The match error should include the line number
where the error was detected.
You should supply a five test cases.
A README file should specify which test cases result in
which outputs. One should be able to run the tests with
the makefile targets: test1, test2, test3, test4, and test5.
Submitting the assignment
To submit your assignment,
delete all object or class files from your
leaving only source code,
a README file,
and any test
cases you may have.
while in your working directory,
submit proglan lusth recognizer
The submit program will bundle up all the files in your current
directory and ship them to me.
This includes subdirectories as well
since all the files
in any subdirectories will also be shipped to me.
You may submit as many times as you want before the deadline; new
submissions replace old submissions.
Make sure you that I will be able to call your recognizer with the
command named recognizer.
The command recognizer must
take a filename as a command line argument.
You must supply a makefile that will compile your recognizer when
responding to the commands make and make run.
The make run command should test your implementation on your own
test files. There should be at least one “good” test file and
a few “bad” ones illustrating various syntax errors.