CPSC510 Notes

Files


Assignment 1

Portions of this assignment that have been implemented:

  • Scanning of CIRL input
  • Parsing of CIRL input into CIRL-tree form
  • Typing of variables (broken)
  • ESEQ-removal (all steps)

Files for this assignment are (included in the .zip file):

  • Cirl.lex -> CirlScanner.java
  • Cirl.cup -> CirlParser.java, CirlSymbols.java
  • RNode.java
  • RTable.java
  • RTools.java

To compile the files you will need:

Compilation can be done as follows (assuming that JLex and java_cup are installed to some directory say ~/, and the above files ans assignment 1 files are saved to some folder):

  • java -cp ".;~/." JLex.Main Cirl.lex
  • rename Cirl.lex.java CirlScanner.java
  • java -cp ".;~/." java_cup.Main -parser CirlParser -symbols CirlSymbols Cirl.cup
  • javac -cp ".;~/." RNode.java
  • javac -cp ".;~/." RTable.java
  • javac -cp ".;~/." CirlSymbols.java
  • javac -cp ".;~/." CirlScanner.java
  • javac -cp ".;~/." CirlParser.java
  • javac -cp ".;~/." RTools.java

RTools can be demonstrated on any input file (to show the resulting output tree) by using the following:

  • java -cp ".;~/." RTools <input file>

Assignment 2

Portions of this assignment that have been implemented:

  • Reading in of a modified rule file for Jouette machine
  • Storing of rules in psuedo-CIRL Tree form
  • Matching algorithm (basic, but no dynamic optimal)

Files for this assignment are (included in the zip file):

  • jouette.txt
  • RTranslate.java
  • RPattern.java

The files from Assignment 1 will be required (as the above files are just an extension of them). Compilation also requires the tools used in Assignment 1.

Compilation can be done as follows (assuming that JLex and java_cup are installed to some directory say ~/, and the above files ans assignment 1 files are saved to some folder):

  • javac -cp ".;~/." RPattern.java
  • javac -cp ".;~/." RTranslate.java

The RTranslate can be tested to show you the result of parsing a rule file simply by doing the following:

  • java -cp ".;~/." RTranslate <input file>
Unless otherwise stated, the content of this page is licensed under Creative Commons Attribution-ShareAlike 3.0 License