From f77e095c6d5da462d26c011621db295376e85d2d Mon Sep 17 00:00:00 2001 From: Roger Date: Sat, 11 Feb 2012 12:33:09 -0200 Subject: [PATCH] uploaded pixel grammar --- Pixel Grammar/Pixel Grammar.txt | 71 +++++++++++++++++++++++++++++++++ 1 file changed, 71 insertions(+) create mode 100644 Pixel Grammar/Pixel Grammar.txt diff --git a/Pixel Grammar/Pixel Grammar.txt b/Pixel Grammar/Pixel Grammar.txt new file mode 100644 index 0000000..c8ac46c --- /dev/null +++ b/Pixel Grammar/Pixel Grammar.txt @@ -0,0 +1,71 @@ +/** + * Copyright 2011 Roger Câmara + * + * Licensed under the Apache License, Version 2.0 (the "License"); + you may not use this file except in compliance with the License. + You may obtain a copy of the License at + + http://www.apache.org/licenses/LICENSE-2.0 + + Unless required by applicable law or agreed to in writing, software + distributed under the License is distributed on an "AS IS" BASIS, + WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + See the License for the specific language governing permissions and + limitations under the License. + + */ + + +"Start Symbol" = + +{ID Head} = {Letter} + [_] +{ID Tail} = {Alphanumeric} + [_] +{String Chars} = {Printable} + {HT} - ["] + +Identifier = {ID Head}{ID Tail}* +StringLiteral = '"' {String Chars}* '"' +IntegerLiteral = {Digit}+ +RealLiteral = {Digit}+.{Digit}+ + +! The grammar starts below + ::= '(' 'def' Identifier '[' ']' ')' + + ::= | + + ::= '(' Identifier ')' + + ::= 'int' | 'real' | 'str' + + ::= | + + ::= '(' ')' + + ::= | | | | | | + + ::= + + ::= Identifier + + ::= Identifier | + + ::= '=' Identifier + + ::= | '(' ')' + + ::= Identifier | LiteralString | LiteralInteger | LiteralReal + + ::= '+' | '-' | '*' | '/' | '&' + + ::= 'read' Identifier + + ::= 'print' + + ::= 'if' + + ::= | + + ::= '(' ')' + + ::= '>' |'<' | '<=' | '>=' | '==' | '!=' + + ::= 'while'