Skip to content

Example Input for the SGLParserTester

MoonShade edited this page Jul 19, 2011 · 3 revisions

Explanation

Input: Input value for the SGL-parser

AST: Abstract Syntax Tree, built with ANTLR

Debug: Debugging messages

Output: Storyboard code (nothing yet)

Examples

Simple variable definition

Input: int x = 3

AST: ast

Debug: Push local variable: int,x,3


Parsing math expressions

Input: int x = 3+4*2-8/10

AST: ast

Debug: Push local variable: int,x,11


Input: int x = (3+4)*-(2-3)

AST: ast

Debug: Push local variable: int,x,7


Expressions with variables

Input:

int x = 4+3
int a = 5*x

AST: ast

Debug:

Push local variable: int,x,7
Try to get variable: x
Push local variable: int,a,35`

Clone this wiki locally