Skip to content

Test Cases and Examples

Clayton Franklin edited this page Oct 19, 2018 · 23 revisions

Test Cases

Test Case Folder

Test Cases

Compiling:

Alt Text

Case 1:

Showing the Lexical Analyzer Output

Case 1a: Error when reading in a token and Setting line number and column number

Lexical Analyzer Error

Case 1b: Correctly finding all tokens in a file

Scanning Correctly

Case 1c: Source Code Debug Flags

Ran with the command ./fcc -i tests/input -o out Lexer Source Debug Flags

Case 2:

Showing the Parser Output

Case 2a: Error in code that does not syntactically match the grammar

Parser Error Source code where the parsing error occured: Parser Error Source Code

Case 2b: Parsing a file correctly and outputting all of the productions

Ran with the command ./fcc -i tests/input -dp Parsing Correctly

Case 2c: Ability to toggle productions on and off inside the file

Ran with the command ./fcc -i tests/input -o out Parser Print in File

Case 3:

Showing the Symbol Table Output

Case 3a: Warning: Shadowing a variable

Shadowing

Case 3b: Error: Redefinition of a previous variable

Redefinition Error

Case 3c: Pushing and Popping Levels on the Symbol Table

STPushPop

Case 3d: Write Symbol Table to File

printSymbolTableToFile