JavaMOP1.0 Syntax

From FSL
Jump to: navigation, search

Links:
MOP
JavaMOP

Grammar of JavaMOP Specifications

A JavaMOP application can contain one or more specifications, not necessarily using the same formalism. All JavaMOP specifications must obey the following syntax:

//The following BNF is extended with [p] and {p} to mean zero or one repetitions of p and zero or more repetitions of p, respectively
 
<Specification> ::= /*@ <Header> <Body> <Handlers> @*/
<Header> ::= <Attribute>*["scope =" <Scope>]["logic =" <Logic>]
<Attribute> ::= "static" | "centralized" | "partial"
<Scope> ::= "global" | "class" ["("<Name>")"]
<Name> ::= <Identifier>
<Logic> ::= <Identifier>
<Body> ::= [<Name>]["("<Parameters>")"]"{"<LogicBody>"}"
<Parameters> ::= <Type> <Identifier> {"," <Type> <Identifier>}
<Handlers> ::= [<ViolationHandler>] [<ValidationHandler>]
<ViolationHandler> ::= "violation handler" "{"<JavaCode>"}"
<ValidationHandler> ::= "validation handler" "{"<JavaCode>"}"

Specifications with the partial attribute cannot have violation handlers or use the @RESET keyword. <JavaCode> is any arbitrary Java Code that would be legal within a method. Each logic plugin should add its unique name to <Logic>.

Grammar of Trace-Related Logic Formalisms

The following grammar is used to specify properties:

//The following BNF is extended with [p] and {p} to mean zero or one repetitions of p and zero or more repetitions of p, respectively
 
<LogicBody> ::= ["["<VarDeclaration>"]"]{<Event>} [<Property>]
<Event> ::= <EventHeader>":"<EventDecl> ["{"<Statement>"}"] [";"]
<EventHeader> ::= "event" <Identifier> ["<"<Parameters>">"]
<EventDecl> ::= <EventPoint> ["with("<Type> <Name>")"][ "&&" <BExp>]
<EventPoint> ::= <BeginOrEnd> "("<EventPattern>")"
<BeginOrEnd> ::= "begin" | "end"
<EventPattern> ::= <CallOrExec> "("<Method>")" | "update("<Field>")"
<CallOrExec> ::= "call" | "exec"

Each logic plugin is free to define the syntax of <Property>.


Personal tools
Namespaces

Variants
Actions
Navigation