Source

311 mini Lexer /

Filename Size Date modified Message
11 B
880 B
1.2 KB
10.9 KB
345 B
140 B
809 B
51 B
2.3 KB
3.4 KB
1.6 KB
127 B
2.9 KB
57 B
441 B
77 B
5.3 KB
9.3 KB
3.6 KB
1.5 KB
125 B
698 B
250 B

311 Mini Lexer

Takes key file and program files. After storing the keys, outputs program files with identifier flags: keyword* , var_first_time? , var_later@ . These are separated by a single space or a new line.

Accomplishes this via a structure like a flat trie. Has a first char leaf, and then a string of the remaining characters, plus a sparse list of indicies to also check, trie style.

For CPP CS 311, winter 2013.

Compliant. Run with java 1.6+

  • javac Project2.java
  • java Project2 InputFile1.txt InputFile2.txt [> out.file]

License

You can copy/use this code at your own risk, provided it isn't for a school project. In that case, you can only view it as reference material.