------------------------------------------------------------------------------
MC logo
Abstract Syntax for for Tucker and Noonan's Clite Language
[^] Syntax
------------------------------------------------------------------------------
[Ch. 1: Overview and History] [Syntax] [Names and Scope] [Types and Type Systems] [Semantics] [Functions] [Memory Management] [Imperitive Programs and Functional Abstraction] [Modular and Class Abstraction] [Functional Programming] [Logic Programming]
[ECFG for Tucker and Noonan's Clite Language] [Plain C CFG] [Abstract Syntax for for Tucker and Noonan's Clite Language] [Derivation Problem] [Regular Expression Problems]
An abstract syntax for Clite.
Program=Declarations decpartStatements body;
Declarations=Declaration*
Declaration=VariableDecl | ArrayDecl
VariableDecl=Variable vType t;
ArrayDecl=Variable vType tInteger size;
Type=int | bool | float | char
Statements=Statement*
Statement=Skip | Block | Assignment | Conditional | Loop
Skip=
Block=Statements
Conditional=Expression test;  Statment thenbranchelsebranch
Loop=Expression test;  Statment body
Assignment=VariableRef targetExpression source
Expression=VariableRef | Value | Binary | Unary
VariableRef=Variable | ArrayRef
Binary=Operator opExpression term1term2
Unary=UnaryOp opExpression term;
Operator=&& | || | == | != | < | <= | > | >= | + | - | * | / | %
UnaryOp=- | !
Variable=String id
ArrayRef=String idExpression index
Value=IntValue | BoolValue | FloatValue | CharValue
IntValue=Integer intValue
FloatValue=Float floatValue
BoolValue=Boolean boolValue
CharValue=Character charValue