Bottom     Previous     Contents

Appendix B
: Picojava Assembly Language Abstract Grammar

<CompilationUnit> ::= { <ClassBased_Class> }

<ClassBased_Class> ::= Identifier <Declarations> { <Method> }

<Method> ::= [ Identifier ] <Parameters> <Block>

<Parameters> ::= { <Parameter> }

<Parameter> ::= <Parameter_Algebraic_SignedInteger5> |
<Parameter_Algebraic_Boolean> |
<Parameter_Structured_Object>

<Parameter_Algebraic_SignedInteger5> = [ Identifier ]

<Parameter_Algebraic_Boolean> = [ Identifier ]

<Parameter_Structured_Object> = [ Identifier ] Identifier

<Block> ::= <Declarations> <Instructions>

<Instructions> ::= { <Instruction> }

<Instruction> ::= <Instruction_Action> | <Instruction_Branch> |
<Instruction_Branch_ConditionalFalse> |
<Instruction_Branch_ConditionalTrue>

<Instruction_Action> ::= <Instruction_Action_Evaluate> |
<Instruction_Action_Load> | <Instruction_Action_Store> |
<Instruction_Action_Create> | Instruction_Action_Discard |
Instruction_Action_DiscardDeep | Instruction_Action_DiscardDeeper |
Instruction_Action_Copy | Instruction_Action_CopyDeep |
Instruction_Action_CopyDeeper

<Instruction_Action_Evaluate> ::= <Instruction_Action_Evaluate_Constant> |
<Instruction_Action_Evaluate_UnaryOp> |
<Instruction_Action_Evaluate_BinaryOp> |
<Instruction_Action_Evaluate_Method>

<Instruction_Action_Evaluate_Constant> ::=
<Instruction_Action_Evaluate_Constant_Algebraic_SignedInteger5> |
<Instruction_Action_Evaluate_Constant_Algebraic_Boolean> |
Instruction_Action_Evaluate_Constant_Structured_Object

<Instruction_Action_Evaluate_Constant_Algebraic_SignedInteger5> ::=
Algebraic_SignedInteger5

<Instruction_Action_Evaluate_Constant_Algebraic_Boolean> ::=
Algebraic_Boolean

<Instruction_Action_Evaluate_UnaryOp> ::=
Instruction_Action_Evaluate_UnaryOp_Invert

<Instruction_Action_Evaluate_BinaryOp> ::=
Instruction_Action_Evaluate_BinaryOp_Product |
Instruction_Action_Evaluate_BinaryOp_Quotient |
Instruction_Action_Evaluate_BinaryOp_Sum |
Instruction_Action_Evaluate_BinaryOp_Difference |
Instruction_Action_Evaluate_BinaryOp_ConditionalAnd |
Instruction_Action_Evaluate_BinaryOp_ConditionalOr |
Instruction_Action_Evaluate_BinaryOp_Less |
Instruction_Action_Evaluate_BinaryOp_Equal |
Instruction_Action_Evaluate_BinaryOp_Congruent

<Instruction_Action_Evaluate_Method> ::= <QualifiedIdentifier>

<Instruction_Action_Load> ::=
<Instruction_Action_Load_Algebraic_SignedInteger5>|
<Instruction_Action_Load_Algebraic_Boolean> |
<Instruction_Action_Load_Structured_Object>

<Instruction_Action_Load_Algebraic_SignedInteger5> ::= <QualifiedIdentifier>

<Instruction_Action_Load_Algebraic_Boolean> ::= <QualifiedIdentifier>

<Instruction_Action_Load_Structured_Object> ::= <QualifiedIdentifier>

<Instruction_Action_Store> ::=
<Instruction_Action_Store_Algebraic_SignedInteger5>|
<Instruction_Action_Store_Algebraic_Boolean> |
<Instruction_Action_Store_Structured_Object>

<Instruction_Action_Store_Algebraic_SignedInteger5> ::= <QualifiedIdentifier>

<Instruction_Action_Store_Algebraic_Boolean> ::= <QualifiedIdentifier>

<Instruction_Action_Store_Structured_Object> ::= <QualifiedIdentifier>

<Instruction_Action_Create> ::= <Instruction_Action_Create_Object>

<Instruction_Action_Create_Object> ::= Identifier Index

<Instruction_Branch> ::= Index

<Instruction_Branch_ConditionalFalse> ::= Index

<Instruction_Branch_ConditionalTrue> ::= Index

<Declarations> ::= { <Declaration> }

<Declaration> ::= <Declaration_Algebraic_SignedInteger5> |
<Declaration_Algebraic_Boolean> | <Declaration_Structured_Object>

<Declaration_Algebraic_SignedInteger5> = Identifier

<Declaration_Algebraic_Boolean> = Identifier

<Declaration_Structured_Object> = Identifier Identifier

<QualifiedIdentifier> = { Identifier } Identifier


Next     Top