ROIS
NPL in EBNF
source ::= MODULE module_name ; imports tasks END module_name
imports ::= 0 { IMPORT module_name ; }
tasks ::= 0 { task ; }
task ::= [CLIENT | HIDDEN] TASK task_name parameters ; defines body task_name
parameters ::= 0 { input_parm | output_parm }
input_parm ::= variable
output_parm ::= : variable
defines ::= 0 { define }
define ::= DEFINE variable ;
body ::= BEGIN 0 { statement ; } END
statement ::= create | open | close | update | from | pragma | dll_call
| foreach | if | exit | internalcall | externalcall
| assignment| textAssignment | return
call ::= [module_name . ] task_name 0 {variable}
create ::= CREATE text AS model
open ::= OPEN text [IN model] AS model
close ::= CLOSE model
update ::= UPDATE model updates
from ::= FROM model TO graph | class select
updates ::= adds | modifies | deletes
adds ::= ADD add_nodeclass | add_linkclass | add_qualifier | add_instance
| add_model | add_link | add_comp | add_mapping | add_text
add_nodeclass ::= NODECLASS text_string | ANONYMOUS [class]
[ BASE node_or_class ]
0{ ALIAS text_string [IN node_or_class] }
PARENTS 1 {node_or_class}
add_linkclass ::= LINKCLASS text_string [class]
[ INVERSE text_string ]
0{ TRANSIT node_or_class }
PARENTS 1{ node_or_class }
[ CARDINALITY cardinality ]
cardinality ::= oneOne | oneMany | manyOne | manyMany
add_qualifier ::= QUALIFIER text_string [class]
SANCTIONED BY node_or_class
PROPERTIES 1{ property}
[ INHERITANCE inheritance ]
property ::= sanctioning | transitive | symmetrical | asymmetrical
| antisymmetrical | reflexive | irreflexive | inverse
inheritance ::= no | normal | default
add_instance ::= INSTANCE text_string | UNIQUE [class]
NODECLASS node_or_class
add_model ::= MODEL text_string [model]
PARENTS node_or_class
add_link ::= LINK link_spec [BEFORE link_spec]
add_comp ::= COMPUTATION node_or_class := computation
computation ::= comp_term 0{ + | - comp_term}
comp_term ::= comp_factor 0{ * | / comp_factor}
comp_factor ::= ( computation ) | node_or_class | number
add_mapping ::= MAPPING ( mapping )
CONTINUOUS node_or_class
DISCRETE node_or_class
mapping ::= identifier { '' identifier }
add_text ::= TEXT text_string
modifies ::= MODIFY mod_nodeclass | mod_linkclass
mod_nodeclass ::= NODECLASS node_or_class
[ BASE node_or_class ]
[ PARENTS 1{ node_class} ]
[ RENAME text_string]
0{ ALIAS text_string [IN node_or_class] }
mod_linkclass ::= LINKCLASS node_or_class
[ PARENTS 1{ node_or_class} ]
0{ TRANSIT node_or_class }
deletes ::= DELETE del_nodeclass | del_linkclass | del_qualifier
| del_instance | del_model | del_link
del_nodeclass ::= NODECLASS node_or_class
del_linkclass ::= LINKCLASS node_or_class
del_qualifier ::= QUALIFIER node_or_class
del_instance ::= INSTANCE node_or_class
del_model ::= MODEL model
del_link ::= LINK link_spec
select ::= SELECT select_parent | select_parents | select_child
| select_children | select_sibling | select_siblings
| select_desc | select_anc | select_node | select_nodes
| select_link | select_links | select_rel | select_rels
select_parent ::= PARENT node_or_class
select_parents ::= PARENTS node_or_class
select_child ::= CHILD node_or_class
select_children ::= CHILDREN node_or_class
select_sibling ::= SIBLING node_or_class PARENT node_or_class
select_siblings ::= SIBLINGS node_or_class PARENT node_or_class
select_desc ::= DESCENDANTS node_or_class
select_anc ::= ANCESTORS node_or_class
select_node ::= NODE select_spec 0{ where }
select_nodes ::= NODES select_spec 0{ where }
select_link ::= LINK select_spec 0{ where }
select_links ::= LINKS select_spec 0{ where }
select_rel ::= RELATION select_spec 0{ where }
select_rels ::= RELATIONS select_spec 0{ where }
select_spec ::= collector . select_lc . select_qual . select_nc
| select_nc . select_lc . select_qual . collector
| select_nc . select_lc . select_qual . select_nc
where ::= WHERE select_spec | where_spec
where_spec ::= where_matches | where_in | where_has
where_matches ::= collector MATCHES text | text_string
where_in ::= collector IN model | graph
where_has ::= collector HAS PARENT | CHILD | ANCESTOR | DESCENDANT | BASE node_or_class
foreach ::= FOREACH foreach_node | foreach_link | foreach_word
| foreach_char | foreach_child | foreach_parent
| foreach_anc | foreach_desc DO body ENDFOR
foreach_node ::= NODECLASS class IN graph | model
foreach_link ::= LINK class . class . class . class IN graph | model
foreach_word ::= WORD text IN text
foreach_char ::= CHARACTER char IN text
foreach_child ::= CHILD class OF class
foreach_parent ::= PARENT class OF class
foreach_anc ::= ANCESTOR [what_first] class OF class
foreach_desc ::= DESCENDANTS [what_first] class OF class
what_first ::= BREADTHFIRST | DEPTHFIRST
exit ::= EXIT
if ::= IF boolean_expr THEN body
0{ ELSIF boolean_expr THEN body}
[ELSE body] ENDIF
boolean_expr ::= [NOT] exists | comparison | bool_rel
exists ::= exists_node | exists_link | exists_rel IN model
exists_node ::= NODE text_string [ LANGUAGE node_or_class]
exists_link ::= LINK link_spec
exists_rel ::= RELATION link_spec
link_spec ::= node_or_class . node_or_class . node_or_class . node_or_class
comparison ::= comp_strings | comp_nodes | comp_graphs
comp_strings ::= text_string EQUALS text_string
comp_nodes ::= qual_or_class EQUALS qual_or_class | NIL
comp_graphs ::= graph EQUALS graph | NIL
bool_rel ::= bool_in | bool_is | bool_has
bool_in ::= qual_or_class IN graph
bool_is ::= qual_or_class IS NODECLASS | LINKCLASS | QUALIFIER | ANONYMOUS | is_instance
is_instance ::= INSTANCE [ OF node_or_class]
internal_call ::= task_name bindings
external_call ::= module_name . task_name bindings
dll_call ::= DLLCALL dll_name . proc_name model [graph | class ]
bindings ::= 0 { binding }
binding ::= variable | value
return ::= RETURN integer
pragma ::= # pragma_debug | pragma_sanc | pragma_inh | pragma_trans
pragma_debug ::= debug on | off | time | profile | variable | text_string
pragma_sanc ::= sanctionMechanism on | off | relaxed
pragma_inh ::= inheritance on | off
pragma_trans ::= transitivity on | off
select_nc ::= select_class | select_graph
select_graph ::= ANY | ALL graph
select_lc ::= select_class
select_qual ::= select_class | sanctioning
select_class ::= class | node_name | *
collector ::= ? identifier
variable ::= class | text | model | graph
class ::= % identifier
text ::= $ identifier
model ::= @ identifier
graph ::= ` identifier
value ::= node_name | qualified_node | text_string
node_or_class ::= node_name | class
qual_or_class ::= qualified_node | class
node_name ::= identifier
qualified_node ::= identifier model
text_string ::= ' string ' | " string " | NAME ( class )
identifier ::= string
module_name ::= string
task_name ::= string
string ::= 1 { a..b | A..B } [ 0 { 0..9 } ]
number ::= integer | real
integer ::= [-] 1 { 0..1 }