G1. Got rid of literal(keyword) thing. Now we can simply use the keywords true, false, etc.
G2. Added keywords NULL=null=0
G3. != works
RESULT = expr;
:}
- | LITERAL OPENPAREN literal:literal CLOSEPAREN
+ | literal:literal
{:
debugMessage(PRODSTRING);
ParseNode expr = new ParseNode("expr", parser.curLine(4));
debugMessage(PRODSTRING);
RESULT = (new ParseNode("literal", parser.curLine(1))).addChild("boolean").addChild("false").getRoot();
:}
+
+ | NULL
+ {:
+ debugMessage(PRODSTRING);
+ RESULT = (new ParseNode("literal", parser.curLine(1))).addChild("decimal").addChild("0").getRoot();
+ :}
| DECIMAL:dec
{:
RESULT = (new ParseNode("literal", parser.curLine(1))).addChild("char").addChild(chr).getRoot();
:}
- | ID:literal
+ | LITERAL OPENPAREN ID:literal CLOSEPAREN
{:
debugMessage(PRODSTRING);
RESULT = (new ParseNode("literal", parser.curLine(1))).addChild("token").addChild(literal).getRoot();
<YYINITIAL> cast { return tok(Sym.CAST, yytext()); }
<YYINITIAL> short { return tok(Sym.SHORT, yytext()); }
<YYINITIAL> null { return tok(Sym.NULL, yytext()); }
+<YYINITIAL> NULL { return tok(Sym.NULL, yytext()); }
<YYINITIAL> crash { return tok(Sym.CRASH, yytext()); }
<YYINITIAL> {ALPHA}({ALPHA}|{DIGIT})* { return tok(Sym.ID, yytext()); }
RESULT = expr;
:}
- | LITERAL OPENPAREN literal:literal CLOSEPAREN
+ | literal:literal
{:
debugMessage(PRODSTRING);
ParseNode expr = new ParseNode("expr", parser.curLine(4));
expr.addChild(literal);
RESULT = expr;
:}
+
| expr:leftexpr LT expr:rightexpr
{:
debugMessage(PRODSTRING);
RESULT = (new ParseNode("literal", parser.curLine(1))).addChild("boolean").addChild("false").getRoot();
:}
+
+ | NULL
+ {:
+ debugMessage(PRODSTRING);
+ RESULT = (new ParseNode("literal", parser.curLine(1))).addChild("decimal").addChild("0").getRoot();
+ :}
| DECIMAL:dec
{:
RESULT = (new ParseNode("literal", parser.curLine(1))).addChild("char").addChild(chr).getRoot();
:}
- | ID:literal
+ | LITERAL OPENPAREN ID:literal CLOSEPAREN
{:
debugMessage(PRODSTRING);
RESULT = (new ParseNode("literal", parser.curLine(1))).addChild("token").addChild(literal).getRoot();
cp -r <path to RepairCompiler>/MCC/Runtime .
B) copy generated files into the Runtime directory
cp ex.cc ex_aux.* size.* Runtime
-B) remove old object files
+C) remove old object files
cd Runtime; rm *.o
-C) ./buildruntime
-D) build checking object:
+D) ./buildruntime
+E) build checking object:
g++ -g -c ex_aux.cc
-E) If ex_test.c is the application under testing, run:
+
+
+Step 4: Check the application
+-----------------------------
+
+If ex_test.c is the application under testing, then:
+
+A) in ex_test.c, add:
+ #include "ex_aux.h"
+ #include "memory.h"
+B) at the beginning of the main method, add:
+ initializemmap();
+C) wherever you want to check the consistency constraints, add:
+ #include "ex.cc"
+D) compile the application:
g++ -g ex_test.cc *.o -o ex_test
-F) ./ex_test
+E) run the application:
+ ./ex_test