Skip to content

Instantly share code, notes, and snippets.

@wbars
Created January 18, 2016 01:25
Show Gist options
  • Save wbars/71f5304e40b69f6c0530 to your computer and use it in GitHub Desktop.
Save wbars/71f5304e40b69f6c0530 to your computer and use it in GitHub Desktop.
PROGRAM program_name;
CONST
e = 2.7182818;
a = 2 * 3;
VAR
a,b: Integer;
c: String;
BEGIN
IF a = b THEN
a = b + c
ELSE
a = b - c;
END.
├── Program
├── Const
├── Expression
├── Identifier(e)
├── Operator(EQUALS)
└── Expression
└── Double(2.7182818)
└── Expression
├── Identifier(a)
├── Operator(EQUALS)
└── Expression
└── Term
├── Int(2)
├── Operator(MULTIPLY)
└── Int(3)
├── Var
├── VarDeclaration
├── Identifier(a)
├── Identifier(b)
├── Separate(COLON)
└── Type(INTEGER)
└── VarDeclaration
├── Identifier(c)
├── Separate(COLON)
└── Type(STRING)
└── CompoundStatement
├── Condition
├── Expression
├── Identifier(a)
├── Operator(EQUALS)
└── Identifier(b)
└── CompoundStatement
└── Expression
├── Identifier(a)
├── Operator(EQUALS)
└── SimpleExpression
├── Identifier(b)
├── Operator(PLUS)
└── Identifier(c)
└── Expression
├── Identifier(a)
├── Operator(EQUALS)
└── Expression
└── SimpleExpression
├── Identifier(b)
├── Operator(MINUS)
└── Identifier(c)
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment