source: liacs/coco/assignment2/DOCUMENTATION.TXT@ 348

Last change on this file since 348 was 2, checked in by Rick van der Zwet, 15 years ago

Initial import of data of old repository ('data') worth keeping (e.g. tracking
means of URL access statistics)

File size: 2.3 KB
Line 
1= INTRODUCTION =
2
3Welcome reader,
4
5You will find our solution on assignment 2 of Compiler Constructions 2008
6giving at LIACS University. First we will you a grand overview of the files
7altered, next we will bullet point the most important design decisions.
8
9And the grand finale will show the usage of the program.
10
11Enjoy!
12Johan and Rick <hvdzwet@liacs.nl>
13
14
15= FILES EDITED/ADDED =
16A coercion.cc = Coercion and checking module C++ code
17A coercion.h = Coercion and checking module C++ header
18E comp.l = Main program lexer flex code
19E comp.y = Main program parser bison code
20E debug.c = Debug printing module C++ code
21E debug.h = Debug printing module C++ header
22A debug.sh = Debug cycle on single test file
23A DOCUMENTATION.TXT = Reading right know :-)
24A messages.cc = Messaging module C++ code
25A messages.h = Messaging module C++ header
26
27= DESIGN DECISIONS =
28* lastOP : Allowing to differentiate without altering the grammar of the language,
29 required the notion of storing the current RELOP and MULOP into lastOP, allowing
30 it to be read later on by the parser, to identity the proper NODE_*
31
32* Separate files for the use of Messaging, Coercion, Debug to keep code
33 readable and more understandable
34
35* For the sake of simplicity not all calls within the Parser are of type Node,
36 some are Symbol, to clearly define we are only using partial information out
37 of it.
38
39* Split calls for recognising the current ID, as the parser could traverse some
40 steps deep, allowing to change the lastID while the corresponding code has
41 not been called. A 'temporary' node will be created and passed along down below
42
43* Parameter listings will first have a unknown return value and made to a
44 linked list right away, ones the return value has found it recursively get
45 added to it pre-assessors
46
47* Creating a new node and type checking will done 'on the fly' e.g. a function
48 is called with a specific node -> conversion/coercion fails/warnings/errors
49 -> specific node or dummy value returned
50
51
52= USAGE =
53# Compile
54$ make first
55$ make
56# Full blown debugging stack
57$ ./comp -w -vvvv <testfile
58# Lexer debugging only
59$ ./comp -w -vvv <testfile
60# All quiet
61$ ./comp -n -qqqq <testfile
62# Normal usage
63$ ./comp <testfile
Note: See TracBrowser for help on using the repository browser.