From 42827b7f01c7e13f21eca39a271a09d712f6aec3 Mon Sep 17 00:00:00 2001 From: Victor Fernandes Date: Tue, 14 Mar 2017 15:54:47 -0400 Subject: [PATCH] Transition table: complete, I think? --- PLATYPUS_Regex.md | 20 ++-- PLATYPUS_Transition_Table.xlsx | Bin 0 -> 10891 bytes table.h | 162 ++++++++++++++++++++++----------- 3 files changed, 118 insertions(+), 64 deletions(-) create mode 100644 PLATYPUS_Transition_Table.xlsx diff --git a/PLATYPUS_Regex.md b/PLATYPUS_Regex.md index f98d368..0f0fa29 100644 --- a/PLATYPUS_Regex.md +++ b/PLATYPUS_Regex.md @@ -10,9 +10,9 @@ L(KEYWORD) = PLATYPUS | IF | THEN | ELSE | USING | REPEAT | INPUT | OUTPUT ``` ## Variable Identifiers ``` -L(LETTER) = [a-zA-Z] +L(L) = [a-zA-Z] -L(LETTER_OR_DIGIT) = [a-zA-Z0-9] +L(LoD) = [a-zA-Z0-9] L(VID) = AVID | SVID @@ -24,24 +24,24 @@ L(SVID) = AVID# ## Integer Literals ``` -L(DEC_INT_LITERAL) = [0-9]* +L(DIL) = 0 | [1-9]* -L(NON_ZERO_DIGIT) = 1 | 2 | 3 | 4 | 5 | 6 | 7 | 8 | 9 +L(NzD) = [1-9] -L(DIGIT) = [0-9]+ +L(D) = [0-9] -L(OCT_DIGIT) = 0 | 1 | 2 | 3 | 4 | 5 | 6 | 7 +L(OD) = [0-7] -L(OCT_DIGIT_LITERAL) = 0(OCT_DIGIT)+ +L(OIL) = 0([0-7])* -L(INT_LITERAL) = (DEC_INT_LITERAL | OCT_INT_LITERAL) +L(IL) = (DIL | OIL) ``` ## Floating Point Literal ``` -L(FLP_LITERAL) = ([0-9]*).([0-9]+) +L(FLPL) = (0 | [1-9]*).[0-9]* ``` ## String Literal ``` -L(STR_LITERAL) = "([a-ZA-Z_0-9])*" +L(STRL) = "([a-ZA-Z_0-9])*" ``` \ No newline at end of file diff --git a/PLATYPUS_Transition_Table.xlsx b/PLATYPUS_Transition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gQJ zq4fI)X6j3$V1+^-VMEu&Sbt`wzOC*5hzV8MzmNBE!Zvdtw7^5S8&b3dBAx|BG~W^f zDfP2*eVDi!)7N>1S(Q{FC9!+c(KTa}Gw*gH*WF!j#H1I9dG*d>#<~?lH?naN;E62o zFA`n9FX(vTA;h6nAG5xqj`CTR(DP7ECw^*V?}H!-Um_-(@J2b?DvP}i%u_zzHBYe0 zd1!1&Xu85Vn~VY5UtHOgWJ`w3F`2xLOPANBra+2bnnQARWalD>Rx(wa(DWtfD(NQw z3y*b{F$0%XNmrUV)CTn<}YinB<<;cxbk zgJJboi0wA};2t2HG!uMX13brlpksONIbR!IhhZ+=RD~N_calbH&*E*)`)JqSQ z4^RFuUl>>>Xi4v%8|wa;u0O8-&|aq~`&WR!w)*@b_}euf%85TU{`@NV*Y<}$3l2iP z%KyC?;#ZtsYvMnV9-%#hzf{P775=r(`BT^osxYYV->RO!BK%sG`-yOi_MgB1e--I| z1^l(j^%L+Oy6Xo0q+e@ZzXJTaPxlkR1MgpB`p>T2ucE(h5d0JsB=~hOKer2hMfq#G z@)H99xF7=n{+7J_D*kJ5`3VpVt$RWh@c$EPeg*xjqy7mA0K`!J>6`xTwiRU&pf(5q Qph15$P%~EeEyw}>4|&x2y8r+H literal 0 HcmV?d00001 diff --git a/table.h b/table.h index 052ab0c..c0bf28d 100755 --- a/table.h +++ b/table.h @@ -1,5 +1,5 @@ /* Filename: table.h - * Transition Table and function declarations necessary for the scanner implementation + * Transition Table and function declarations necessary for the scanner implementation * as required for CST8152 - Assignment #2. * Version: 1.17.1 * Date: 30 January 2017 @@ -21,60 +21,101 @@ #include <_null.h> /* NULL pointer constant is defined there */ #endif -/* Source end-of-file (SEOF) sentinel symbol - * '\0' or only one of the folowing constants: 255, 0xFF , EOF - */ + /* Source end-of-file (SEOF) sentinel symbol + * '\0' or only one of the folowing constants: 255, 0xFF , EOF + */ -/* Single-lexeme tokens processed separately one by one - * in the token-driven part of the scanner - * '=' , ' ' , '(' , ')' , '{' , '}' , == , <> , '>' , '<' , - * space - * ! , '>' , '<' , + * space + * !