7.8
|
Statements
|
|
|
| |
Statement |
LoopStatement | CaseStatement | IfStatement | AssignmentStatement
| RoutineStatement | AssemblyStatement | DeclarationStatement | BlockStatement
| GuardStatement | FailStatement | RecoverStatement | HandleStatement |
| |
LoopStatement |
tLoop [ VariableDeclaration ] { tOpenBrace { [ Statement | EmptyStatement
] [ ConditionalStatement ] }* tCloseBrace } | { [ Statement | EmptyStatement
] [ ConditionalStatement ] } |
| |
CaseStatement |
tCase [ VariableDeclaration ] Block(CaseConditionalStatement) tOpenBrace
{ ConditionalStatement [ Statement | EmptyStatement ] }* tCloseBrace |
| |
IfStatement |
tIf ConditionalStatement [ { tElse ConditionalStatement }* tElse {
Statement | EmptyStatement } ] |
| |
AssignmentStatement |
{ Expression { tComma Expression }+ tAssign Expression { tComma Expression
}+ tSemicolon } | { Expression { tComma Expression }+ Operator tWhitespace
tAssign Expression { tComma Expression }+ tSemicolon } |
| |
RoutineStatement |
Identifier tOpenParen [ Expression { tComma Expression }+ ] tCloseParen
tSemicolon |
| |
AssemblyStatement |
tAssembly tColon tOpenBrace { { tOpenBrace Expression tCloseBrace
} | tCloseBrace~ }* tCloseBrace |
| |
DeclarationStatement |
Declaration tSemicolon |
| |
BlockStatement |
tOpenBrace { Statement | EmptyStatement }* tCloseBrace |
| |
GuardStatement |
tGuard VariableDeclaration tOpenBrace { Statement ConditionalStatement
}* tCloseBrace |
| |
FailStatement |
tFail tOpenParen Expression [ tComma Expression ] tCloseParen tSemicolon |
| |
RecoverStatement |
tRecover tOpenParen Expression [ tComma Expression ] tCloseParen tSemicolon |
| |
HandleStatement |
tHandle ParameterDefinition BlockStatement |
| |
ConditionalStatement |
tConditional tOpenParen Expression tCloseParen { Statement | EmptyStatement
} { { tJunction | tDisjunction } Parenthetical(Expression) { Statement
| EmptyStatement } }* |
| |
EmptyStatement |
tSemicolon |
7.9
|
Declarations
|
|
|
| |
Declaration |
ScopeDeclaration | RoutineDeclaration | ImportDeclaration | TypeDeclaration
| VariableDeclaration | PrecedenceDeclaration |
| |
IdentifierDeclaration |
Identifier { tComma Identifier }+ tColon [ ScopeSpecifier ] [ AccessSpecifier
] [ StorageSpecifier ] |
| |
ScopeSpecifier |
tExport |
| |
AccessSpecifier |
tConstant |
| |
StorageSpecifier |
tVolatile |
| |
ScopeDeclaration |
IdentifierDeclaration tOpenBrace Block(DeclarationStatement) |
| |
VariableDeclaration |
IdentifierDeclaration TypeDefinition ! [ tAssign Expression { tComma Expression
}* ] |
| |
TypeDeclaration |
IdentifierDeclaration tType ! TypeDefinition ! [ tOpenBrace { OperatorDefinition
}* tCloseParen ] |
| |
OperatorDefinition |
{ Operator | tCoerce } tColon tOperator ! ParameterDefinition ! ResultDefinition
! [ tPrecedence tAssign Identifier ] ! BlockStatement ! |
| |
RoutineDeclaration |
IdentifierDeclaration RoutineType ! [ BlockStatement ] |
| |
ImportDeclaration |
IdentifierDeclaration tImport |
| |
PrecedenceDeclaration |
IdentifierDeclaration tPrecedence ! [ { tLessThan | tGreaterThan | tEqual
} Identifier ] |
| |
TypeDefinition |
[ GroupType ] { RoutineType | RecordType | EnumType | BaseType | InternalType
| Identifier } |
| |
RoutineType |
tRoutine ParameterDefinition [ ResultDefinition ] |
| |
ParameterDefinition |
tOpenParen [ VariableDeclaration { tSemicolon VariableDeclaration }* ]
tCloseParen |
| |
ResultDefinition |
ParameterDefinition |
| |
RecordType |
tRecord tOpenBrace { DeclarationStatement }* tCloseBrace |
| |
EnumType |
tEnum TypeDefinition tOpenParen Identifier { tSemicolon Identifier }*
tCloseParen tMap tOpenParen [ Expression ] { tSemicolon [ Expression ] }*
tCloseParen |
| |
InternalType |
NumberType | CharacterType | LogicalType |
| |
BaseType |
BitType | RegisterType |
| |
NumberType |
tNumber |
| |
CharacterType |
tCharacter |
| |
LogicalType |
tLogical |
| |
BitType |
tBit |
| |
RegisterType |
tRegister |
| |
GroupType |
{ tReference | ArrayType }+ |
| |
ArrayType |
tOpenBracket [ [ Expression ] { tComma [ Expression ] }* ] tCloseBracket |
7.13.1
|
Preprocessor Tokens & Macros
|
|
|
| |
tPreprocess |
# |
| |
TPreprocess |
# |
| |
tRest |
rest |
| |
tMacro |
macro |
| |
tPipe |
| |
| |
pStream |
{ pPreprocess | TPreprocess }* |
| |
pPreprocess |
pEscape | pStatement | pExpression | pInsert | pComment |
| |
pEscape |
tPreprocess ! |
| |
pExpression |
tPreprocess $ Expression $ tPreprocess |
| |
pInsert |
tPreprocess lString tPreprocess |
| |
pStatement |
tPreprocess ws pSingleStatement* ws tPreprocess |
| |
pSingleStatement |
pLoopStatement | pIfStatement | pBlockStatement | pStreamStatement
| pAssignmentStatement | pMacroInvocationStatement | pMacroDefinitionStatement
| pExpression | pLiteralStatement |
| |
pLiteralStatement |
tPreprocess tPipe pStream tPipe tPreprocess |
| |
pLoopStatement |
tLoop tOpenBrace { pLoopConditionalStatement }* tCloseBrace |
| |
pLoopConditionalStatement |
[ pStatement ] [ pConditionalStatement ] |
| |
pIfStatement |
tIf pConditionalStatement [ { tElse pConditionalStatement }* tElse
{ pStatement } ] |
| |
pConditionalStatement |
tConditional tOpenParen Expression tCloseParen pStatement { { tJunction
| tDisjunction } tOpenParen Expression tCloseParen pStatement }* |
| |
pBlockStatement |
tOpenBrace { pStatement }* tCloseBrace |
| |
pStreamStatement |
ws tPreprocess pStream tPreprocess ws |
| |
pAssignmentStatement |
SimpleIdentifier { tComma SimpleIdentifier }* tAssign Expression {
tComma Expression }* tSemicolon | SimpleIdentifier { tComma SimpleIdentifier
}* Operator ws tAssign Expression { tComma Expression }* tSemicolon |
| |
pMacroInvocationStatement |
SimpleIdentifier tOpenParen Expression { tComma Expression }* tCloseParen |
| |
pMacroDefinitionStatement |
SimpleIdentifier tColon tMacro tOpenParen SimpleIdentifier { tSemicolon
SimpleIdentifier }* [ tSemicolon tRest ] tCloseParen pStatement |