From 38fc2ad58179d17e842d6f87c354b2a077f4bd9b Mon Sep 17 00:00:00 2001 From: Victor Fernandes Date: Mon, 13 Mar 2017 13:02:25 -0400 Subject: [PATCH] bnf --- PLATYPUS Grammar Specification.md | 42 +++++++++++++++---------------- 1 file changed, 21 insertions(+), 21 deletions(-) diff --git a/PLATYPUS Grammar Specification.md b/PLATYPUS Grammar Specification.md index 7cad763..a725358 100644 --- a/PLATYPUS Grammar Specification.md +++ b/PLATYPUS Grammar Specification.md @@ -22,7 +22,7 @@ This does not follow standard BNF/EBNF syntax, I will rewrite it once I get all | | | | ``` ### 2.2 White Space -``` +``` bnf ::= ASCII SP character (space) | ASCII HT character (horizontal tab) @@ -34,7 +34,7 @@ This does not follow standard BNF/EBNF syntax, I will rewrite it once I get all CR | LF | CR LF ``` ### 2.3 Comments -``` +``` bnf ::= !< @@ -45,7 +45,7 @@ This does not follow standard BNF/EBNF syntax, I will rewrite it once I get all but not ``` ### 2.4 Variable Identifiers -``` +``` bnf ::= | @@ -68,12 +68,12 @@ This does not follow standard BNF/EBNF syntax, I will rewrite it once I get all # ``` ### 2.5 Keywords -``` +``` bnf ::= PLATYPUS | IF | THEN | ELSE | USING | REPEAT | INPUT | OUTPUT ``` ### 2.6 Integer Literals -``` +``` bnf ::= | @@ -103,15 +103,15 @@ This does not follow standard BNF/EBNF syntax, I will rewrite it once I get all ``` ### 2.7 Floating-point Literals -``` +``` bnf ::= . ``` ### 2.8 String Literals -``` +``` bnf ::= ε | - + ::= "" @@ -122,12 +122,12 @@ This does not follow standard BNF/EBNF syntax, I will rewrite it once I get all | ``` ### 2.9 Separators -``` +``` bnf ::= ( | ) | { | } | , | ; | " |. ``` ### 2.10 Operators -``` +``` bnf ::= | | | @@ -150,7 +150,7 @@ This does not follow standard BNF/EBNF syntax, I will rewrite it once I get all ``` ## 3. The PLATYPUS Syntactic Specification ### 3.1 PLATYPUS Program -``` +``` bnf ::= PLATYPUS {} SEOF @@ -161,7 +161,7 @@ This does not follow standard BNF/EBNF syntax, I will rewrite it once I get all | ``` ### 3.2 Statements -``` +``` bnf ::= | @@ -170,7 +170,7 @@ This does not follow standard BNF/EBNF syntax, I will rewrite it once I get all | ``` ### 3.3 Assignment Statement -``` +``` bnf ::= ; @@ -179,18 +179,18 @@ This does not follow standard BNF/EBNF syntax, I will rewrite it once I get all | = ``` #### 3.2.2 Selection Statement (`if` statement) -``` +``` bnf ::= IF () THEN ELSE {}; ``` #### 3.2.3 Iteration Statement (the loop statement) -``` +``` bnf ::= USING ( , , ) REPEAT { }; ``` #### 3.2.4 Input Statement -``` +``` bnf ::= INPUT (); @@ -201,13 +201,13 @@ This does not follow standard BNF/EBNF syntax, I will rewrite it once I get all | , ``` #### 3.2.5 Output Statement -``` +``` bnf ::= OUTPUT( | ); ``` ### 3.3 Expressions #### 3.3.1 Arithmetic Expressions -``` +``` bnf ::= | @@ -233,7 +233,7 @@ This does not follow standard BNF/EBNF syntax, I will rewrite it once I get all | () ``` #### 3.3.2 String Expression -``` +``` bnf ::= | << @@ -243,7 +243,7 @@ This does not follow standard BNF/EBNF syntax, I will rewrite it once I get all | ``` #### 3.3.3 Conditional Expression -``` +``` bnf // BNF from C specification adapted to PLATYPUS // source: https://cs.wmich.edu/~gupta/teaching/cs4850/sumII06/The%20syntax%20of%20C%20in%20Backus-Naur%20form.htm ::= @@ -259,7 +259,7 @@ This does not follow standard BNF/EBNF syntax, I will rewrite it once I get all // END BNF from C specification ``` #### 3.3.4 Relational Expression -``` +``` bnf ::= |