.. _`Appendix A`: ########## Appendix A ########## .. _`Scripting BNF`: Scripting BNF ************* *This Appendix gives the formal description of the Tester Scripting language.* TOKENS ====== :: TOKENS SKIP : { " " | "\t" | "\n" | "\r" | <"//" (~["\n","\r"])* ("\n" | "\r" | "\r\n")> | <"--" (~["\n","\r"])* ("\n" | "\r" | "\r\n")> | <"/*" (~["*"])* "*" ("*" | ~["*","/"] (~["*"])* "*")* "/"> } TOKEN : { (["l","L"])? | (["l","L"])? | (["l","L"])?> | <#DECIMAL_LITERAL: (["+","-"])? ["0"-"9"] (["0"-"9"])*> | <#HEX_LITERAL: "0" ["x","X"] (["0"-"9","a"-"f","A"-"F"])+> | <#OCTAL_LITERAL: "0" (["0"-"7"])*> | )? (["f","F","d","D"])? | "." (["0"-"9"])+ ()? (["f","F","d","D"])? | (["0"-"9"])+ (["f","F","d","D"])? | (["0"-"9"])+ ()? ["f","F","d","D"]> | <#EXPONENT: ["e","E"] (["+","-"])? (["0"-"9"])+> | | | | } TOKEN : { | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | } TOKEN : { ( | )*> | <#LETTER: ["$","A"-"Z","_","a"-"z"]> | } NON-TERMINALS ============= :: NON-TERMINALS Scenario := ( InstructionList )? Macro := "(" ( ArgumentList )? ")" ( InstructionList )? | ( InstructionList )? InstructionList := ( Instruction )+ Instruction := SendInstruction | RepeatInstruction | PeriodicInstruction | DisposeInstruction | WriteDisposeInstruction | WaitInstruction | WaitabsInstruction | CheckInstruction | CheckLastInstruction | CheckAnyInstruction | RecheckLastInstruction | DisposedInstruction | MarkInstruction | MarkMsgInstruction | MissInstruction | MissMsgInstruction | CallInstruction | ForInstruction | WhileInstruction | SetInstruction | VarDeclaration | IfInstruction | MessageInstruction | ClearInstruction | LogInstruction | FailInstruction | ReaderInstruction | WriteInstruction | ReadInstruction | ConnectInstruction | DisconnectInstruction | ExecuteInstruction | ControlInstruction | ColumnInstruction | GraphInstruction | ReverseFailInstruction | ExitInstruction | ScriptInvocation ReaderInstruction := ( )? "(" Constant ()? ( "," ( "," Constant ( "," Constant )? )? )? ");" ColumnInstruction := ( )? "(" Constant ( "," Constant )? ");" GraphInstruction := "(" ParameterList ");" MessageInstruction := "(" ( Constant )? ");" LogInstruction := "(" ( Constant )? ");" FailInstruction := "(" ( Constant )? ");" ControlInstruction := "." ( ( "(" ParameterList ( ( ");" ) | ( ")" ";" ) ) ) | ( ";" ) ) ClearInstruction := ";" ExitInstruction := ( )? ";" ScriptInvocation := Script ";" SendInstruction := ( ( "." ) )? "(" ( ParameterList )? ");" RepeatInstruction := FloatValue IntValue "(" ( ParameterList )? ");" PeriodicInstruction := FloatValue IntValue "(" ( ParameterList )? ");" WriteInstruction := "." "(" ( ParameterList )? ");" VarDeclaration := FieldName "=>" Constant ";" DisposeInstruction := ( ( "." ) )? "(" ( ParameterList )? ");" WriteDisposeInstruction := ( ( "." ) )? "(" ( ParameterList )? ");" CheckInstruction := ( ( "." ) )? "(" ( ChkParameterList )? ");" CheckLastInstruction := ( ( "." ) )? "(" ( ChkParameterList )? ");" CheckAnyInstruction := ( ( "." ) )? "(" ( ChkParameterList )? ");" RecheckLastInstruction := ( ( "." ) )? "(" ( ChkParameterList )? ");" ReadInstruction := "." "(" ( ChkParameterList )? ");" MarkMsgInstruction := "." "(" ( ChkParameterList )? ");" MissMsgInstruction := "." "(" ( ChkParameterList )? ");" ConnectInstruction := ( Constant )? ";" DisconnectInstruction := ";" DisposedInstruction := ( ( "." ) )? "(" ( ChkParameterList )? ");" MissInstruction := ( ( "." ) )? "(" ( ChkParameterList )? ");" MarkInstruction := ( ( "." ) )? "(" ( ChkParameterList )? ");" CallInstruction := ( ( "." ) )? "(" ( ParameterList )? ");" SetInstruction := "(" ( ParameterList )? ")" "(" "(" ParamHeaderList ")" ParamSetList ");" ParamHeaderList := ( "," ParamHeaderList )? ParamSetList := "," ParamSet ( ParamSetList )? ParamSet := "(" ParamValueList ")" ParamValueList := Constant ( "," ParamValueList )? IfInstruction := "(" CompareExpression ")" InstructionList ( InstructionList )? ";" CompareExpression := CalcExpression ( CompareOperator CompareExpression )? CalcExpression := PrimaryExpression ( CalcOperator CalcExpression )? PrimaryExpression := Constant | "(" CompareExpression ")" CompareOperator := "==" | "!=" | ">" | "<" | ">=" | "<=" | "||" | "&&" CalcOperator := "|" | "&" | "+" | "-" | "*" | "/" ForInstruction := ( ( IntValue ".." IntValue ) | "(" VarList ")" ) InstructionList ";" WhileInstruction := "(" CompareExpression ")" InstructionList ";" VarList := Constant ( "," VarList )? WaitInstruction := "(" Constant ");" WaitabsInstruction := "(" Constant ");" ExecuteInstruction := ( )? ( )? ";" ReverseFailInstruction := ";" ParameterList := Parameter ( "," Parameter )* ( "," )? Parameter := FieldName "=>" Constant ChkParameterList := ChkParameter ( "," ChkParameter )* ( "," )? ChkParameter := FieldName "=>" ( "!" )? Constant ( ":" Constant )? ArgumentList := Argument ( Argument )* Argument := FieldName ":" FieldName ( ":=" Constant )? ";" FieldName := ( "[" "]" )? ( ( "." FieldName ) )? IntValue := | "<<" | FloatValue := | "<<" | Constant := | | | | ">>" | ">>" | "<<" ( "." )? | | | Script := .. END