- Remove the main from the
scanner.l
. - Remove all the
#define [TOKEN] [INDEX]
inscanner.l
(we define them in parser.y with%token
). - Add
#include "parser.h"
in yourscanner.l
. - Add a
#pragma token on
and#pragma token off
to control[INFO]
andtoken(type:...)...
message, default is off. - Scanner should not handle negative numbers, please remove all
[+-]
at the begining ofinteger
,scientific
,float
rules inscanner.l
. And plese add rule offactor ::= sub factor
in parser to handle negative numbers.
Please follow the grammar in 01-minipascal-spec.pdf
to write your syntax rule in parser.y
.
Note: You don't need to create a grammar yourself, just use the grammar in 01-minipascal-spec.pdf
.
Please run make debug
to see how many testcases you could pass.
You will get the exact grade if you define your behavior properly in scanner/parser
(e.g. no hard-coded, no edit the testcase ... )
Please run make pack
and upload the compressed file to E3.
Please use make debug
in the docker, and it will create a png file.