Differences

This shows you the differences between two versions of the page.

Link to this comparison view

Both sides previous revision Previous revision
Next revision
Previous revision
courses:cs331-201701:parser [2018/09/20 23:44]
sellis [Resources]
courses:cs331-201701:parser [2019/02/07 14:19]
sellis [Design]
Line 33: Line 33:
 To initialise the parser, the stack must contain the distinguished symbol of the grammar, ''<​Goal>'',​ with the ''​ENDOFFFILE''​ terminal symbol underneath it. Once this is done, the parser is ready to go. To initialise the parser, the stack must contain the distinguished symbol of the grammar, ''<​Goal>'',​ with the ''​ENDOFFFILE''​ terminal symbol underneath it. Once this is done, the parser is ready to go.
  
 +=== Suggestion ===
 +
 +It is **strongly recommended** you do not hard-code the grammar and parse table, but instead write functions to load them from disc. This is, however, only a recommendation:​ your program is your own to design. :-)
 ==== Resources ==== ==== Resources ====
  
Line 43: Line 46:
 === Sample Parses === === Sample Parses ===
  
-  - [[https://​www.cs.vassar.edu/​~cs331/​proj/​02_parser/​simple.txt|Source code]] --> [[https://​www.cs.vassar.edu/​~cs331/​proj/​02_parser/​simple_out.txt|Completed parse]] +  - [[https://​www.cs.vassar.edu/​~cs331/​proj/​02_parser/​simple.txt|Source code]] --> [[https://​www.cs.vassar.edu/​~cs331/​proj/​02_parser/​simple_out.txt|Completed parse]] ​(69 steps). 
-  - [[https://​www.cs.vassar.edu/​~cs331/​proj/​02_parser/​ult-corrected.txt|Source code]] --> [[https://​www.cs.vassar.edu/​~cs331/​proj/​02_parser/​ult-corr_out.txt|Completed parse]]+  - [[https://​www.cs.vassar.edu/​~cs331/​proj/​02_parser/​ult-corrected.txt|Source code]] --> [[https://​www.cs.vassar.edu/​~cs331/​proj/​02_parser/​ult-corr_out.txt|Completed parse]] ​(1385 steps).
 ==== Error Handling ==== ==== Error Handling ====