0% found this document useful (0 votes)
23 views

Java Dialect Semantic: XERO CODER Online Help

The document describes the grammar for a Java-like programming language, defining the structure and syntax rules for programs, statements, expressions, and other language elements. Key elements include blocks of statements enclosed in curly braces, import statements to import packages, variable declarations with optional initialization values, arrays, expressions, relational and arithmetic operators, and statement types like assignment, if/else, return, and function calls.

Uploaded by

naxo128
Copyright
© © All Rights Reserved
We take content rights seriously. If you suspect this is your content, claim it here.
Available Formats
Download as PDF, TXT or read online on Scribd
0% found this document useful (0 votes)
23 views

Java Dialect Semantic: XERO CODER Online Help

The document describes the grammar for a Java-like programming language, defining the structure and syntax rules for programs, statements, expressions, and other language elements. Key elements include blocks of statements enclosed in curly braces, import statements to import packages, variable declarations with optional initialization values, arrays, expressions, relational and arithmetic operators, and statement types like assignment, if/else, return, and function calls.

Uploaded by

naxo128
Copyright
© © All Rights Reserved
We take content rights seriously. If you suspect this is your content, claim it here.
Available Formats
Download as PDF, TXT or read online on Scribd
You are on page 1/ 4

XERO CODER Online Help

Java Dialect Semantic


Program -> StatementsStatements -> Statement...

Block -> '{' Statements '}'

ImportStmt -> IMPORT (String/,)...

VarStmt -> VAR (VarDecl/',')...

VarDecl -> Ident [Array] [InitValue]

Array -> '[' (ArrayDim/',')... ']'

ArrayDim -> Expression

InitValue -> '=' Expression

Expression -> SimpleExpression [RelOp SimpleExpression]...

SimpleExpression -> ['-'] Term [AddOp Term]...

Term -> Factor [MulOp Factor]...

Factor -> Designator


-> UnsignedNumber
-> String
-> '(' Expression ')'
-> '!' Factor

-> '[' SetConstructor ']'


-> NewOperator
-> '<' FRString '>'

SetConstructor -> SetNode/','...

SetNode -> Expression ['..' Expression]

NewOperator -> NEW Designator

RelOp -> '>'


-> '<'
-> '<='
-> '>='
-> '!='
-> '=='
-> IN
-> IS

AddOp -> '+'


-> '-'
-> '||'
-> '^'

MulOp -> '*'


-> '/'
-> '%'
-> '&&'
-> '<<'
-> '>>'

Designator -> ['&'] Ident ['.' Ident | '[' ExprList ']' | '(' [ExprList] ')']...

ExprList -> Expression/','...

Statement -> (AssignStmt | CallStmt | BreakStmt | ContinueStmt |


DeleteStmt | DoWhileStmt | ForStmt | FunctionStmt |
IfStmt | ImportStmt | ReturnStmt | SwitchStmt |
VarStmt | WhileStmt | WithStmt | Block) [';']

BreakStmt -> BREAK

ContinueStmt -> CONTINUE

DeleteStmt -> DELETE Designator

AssignStmt -> Designator ['+'|'-'|'*'|'/']'=' Expression

CallStmt -> Designator ['+''+'|'-''-']

ReturnStmt -> RETURN [Expression]

IfStmt -> IF '(' Expression ')' Statement [ELSE Statement] SwitchStmt -> SWITCH '(' Expression ')'
'{' (CaseSelector)... [DEFAULT ':' Statement] '}'

CaseSelector -> CASE SetConstructor ':' Statement

DoWhileStmt -> DO Statement [';'] WHILE '(' Expression ')' ';'


XERO LTD.

You might also like