cs315_proj_part2

A Figure Drawing Language - Part II

In Part I we have asked you to do the following:

  • Design a language (give it a name) to meet the requirements described above.
  • Write a tutorial for the language you have designed.
  • Write 3 sample programs, each drawing a non-trivial figure.
  • Write a report describing how you addressed each requirement. Describe which examples and which lines cover which requirements.
  • Write a BNF grammar for your language.
  • Write a lexer for your language, using Lex.

In Part II, we ask you to implement the BNF grammar using yacc. The end result will be a parser that either accepts a given input program as correct, or outputs a list of erroneous lines. Your parser should be able to work with your input programs. A few hits follow:

  • Typically, a grammar is not sufficient to catch all errors in a program. Examples include type errors, use before definition errors, etc. You will get extra points if you can catch such errors in your program (this requires writing extra C/C++ code in addition to the yacc grammar).
  • It is very annoying to the users of your program if the parser terminates on the first error. Ideally, it should report multiple errors, before bailing out. You will get extra points if you could achieve this.

Deliverables

  • The parser code, with a Makefile
  • 3 sample programs that are correct
  • 10 sample programs, each illustrating a different kind of error in your program
  • The output from your parser for the 10 incorrect programs
  • A report describing the challenges you have faced and how you addressed them

Logics

Once you are done, put your deliverables under a directory named group<GroupNo>_proj2 and make an archive from that directory. It is important that your code should compile without any issues using the make command. Once complete, it should output an executable called 'parser' that can be used to parse your sample input. For example, the following Unix commands could be used:

  mkdir group<GroupNo>_proj2    
  cd group<GroupNo>_proj2
      mkdir code      # contains Makefile, lex, yacc, and C code
      mkdir samples   # contains the program samples
      (edit and test your files)
      ...
  cd ..
  tar -cvzf group<GroupNo>_proj2.tar.gz group<GroupNo>_proj2

Then e-mail this newly generated file (named group<GroupNo>_proj2.tar.gz) to your TA Doğukan Çağatay (dogukan.cagatay@bilkent.edu.tr).

Reports in formats other than .pdf and .txt are not accepted.

cs315_proj_part2.txt · Last modified: 2013/04/03 20:48 by bgedik

Page Tools