From c51d1962dcb94b33d23e79c8e8f89f28c6b5f60f Mon Sep 17 00:00:00 2001 From: Victor Fernandes Date: Fri, 10 Feb 2017 15:47:24 -0500 Subject: [PATCH] Start Language specification --- PLATYPUS Grammar Specification.md | 95 +++++++++++++++++++++++++++++++ 1 file changed, 95 insertions(+) create mode 100644 PLATYPUS Grammar Specification.md diff --git a/PLATYPUS Grammar Specification.md b/PLATYPUS Grammar Specification.md new file mode 100644 index 0000000..4e9b778 --- /dev/null +++ b/PLATYPUS Grammar Specification.md @@ -0,0 +1,95 @@ +# PLATYPUS Language Specification + +## Lexical Specification (INCOMPLETE) + +## NOTE: **This is incredibly incomplete and broken, I am simply writing this down and will fix it as I read along the informal language specification provided to me** + +1. Input Elements and Tokens +``` + -> + ASCII characters but not SEOF + + -> + SEOF + + -> + | + + -> + | | + | | | | +``` +2. White Space +``` + -> + ASCII SP character (space) + | ASCII HT character (horizontal tab) + | ASCII VT character (vertical tab) + | ASCII FF character (form feed) + | + + -> + CR | LF | CR LF +``` +3. Comments +``` + -> + !< + + -> + | + + -> + but not +``` +4. Variable Identifiers +``` + -> + | + + -> + + + -> + | + + -> one of + [a-z][A-Z] + + -> one of + [a-z][A-Z][0-9] + + -> + # +``` +5. Keywords +``` + -> + PLATYPUS | IF | THEN | ELSE | USING | REPEAT | INPUT | OUTPUT +``` +6. Integer Literals +``` + -> + | + + -> + 0 | + + -> + | + + -> + 0 | + + -> one of + [1-9] + + -> + 0 + + -> + 0 | 1 | 2 | 3 | 4 | 5 | 6 | 7 + + -> + | +