//
// The class dictionaries which define the inputs to our tools are
// available with the following copyright notice:
// Copyright (C) 1990-1993 Northeastern University.
// Permission is granted to any individual or
// institution to use, copy, modify,
// and distribute this class dictionary,
// provided that this complete copyright
// and permission notice is maintained,
// intact, in all copies and supporting
// documentation.
////////////////////////////////////////////////////////////////////////////////
// possible inputs
////////////////////////////////////////////////////////////////////////////////
Demeter_in = Input.
Input : Cd_graph // schema
| Propagation_patterns // implementations of propagation patterns
| Propagation_schema .
Propagation_schema = [ "*source*" Vertex_selector *l ]
[ "*target*" Vertex_selector *l ]
+ "*paths*" *l + Cd_graph - - *l.
Schema_name = DemIdent.
File_name = DemString.
Dir_name = "*directive*" DemIdent .
Class_set_name = "*class-set*" DemIdent .
CRFV_name = Term. // Class Relation Var Function
////////////////////////////////////////////////////////////////////////////////
// schema definition
////////////////////////////////////////////////////////////////////////////////
Cd_graph = Nlist(Adjacency)
[ + "*dfs_n*" DemNumber - *l ]
[ + "*current_component*" DemNumber - *l ]
[ + "*stack*" List(Adjacency) - *l ]
[ + "*matrix*" List(SCC_component) - *l ]
[ + "*terminal_sets*" Commalist(Vertex) "." - *l ] .
Adjacency = < source > Vertex
["(" < parameters> Commalist(Vertex) ")"]
< ns > Neighbors *l
[ + "*intransportedargs*" Commalist(Param_decl) - *l ]
[ + "*outtransportedargs*" Commalist(Param_decl) - *l ]
[ + "*assignments*" List(Param_assignment) - *l ]
[ + "*propagate*" DemString - *l ]
[ + "*generated*" DemString - *l ]
[ + "*tempmark*" DemString - *l ]
[ + "(*signatures*" Commalist(Signature) ")" - *l ]
[ + "(*inherits*" List(Vertex) ")" - *l ]
[ $int ]
[ + "*dfs*" DemNumber - *l ]
[ + "*high*" DemNumber - *l ]
[ + "*scc*" DemNumber - *l ]
"." .
Neighbors : Neighbors_wc | Repetit_n *common*.
Neighbors_wc : Construct_ns | Alternat_ns
*common* *l + + + < construct_ns > List(Any_vertex) - - - .
Construct_ns = "=".
Alternat_ns = ":" [ *l + + + Barlist(Term) - - - ] Common .
Common = + + + "*common*" - - - .
Repetit_n = "~" [ Sandwich(Kernel) ].
Kernel = [ Term ] "{" Sandwich(Term) "}".
Any_vertex : Opt_labeled_term | Optional_term | Syntax_vertex | Inherit_term
*common*
[ + + + "*AnyVertexcallValues*" Commalist(Param_decl) "." - - - *l ]
[ + + + "*bypass_at_anyvertex*" DemString - - - *l ]
[ + + + "*propagate_edges_at_anyvertex*" DemString - - - *l ] *l.
Vertex = < vertex_name > DemIdent
[ *l + + + "*callValues*" Commalist(Param_decl) "." - - - ]
[ *l + + + "*bypass_at_vertex*" DemString - - - ]
[ *l + + + "*propagate_EAr_at_vertex*" DemString - - - ].
Syntax_vertex : Regular_syntax | Print_command *common*.
Print_command : Print_indent | Print_unindent | Print_skip | Print_space *common*.
Print_indent = "+" .
Print_unindent = "-" .
Print_skip = "*l" .
Print_space = "*s" .
Regular_syntax = < string > DemString .
Opt_labeled_term : Labeled | Regular
*common* [StaticSpec] [AccessorSpec] Term.
StaticSpec = "*static*" .
AccessorSpec : ReadOnlyAcc | PrivateAcc *common* .
ReadOnlyAcc = "*read-only*" .
PrivateAcc = "*private*" .
Regular = .
Labeled = "<" < label_name > DemIdent ">" .
Inherit_term = "*inherit*" Commalist(Term).
Term : Normal | CppTerm
*common* Vertex
TermRef
[ *l + + + "(" Commalist(Term) ")" - - - ]
[ *l + + + "*TermcallValues*" Commalist(Param_decl) "." - - - ]
[ *l + + + "*bypass_at_term*" DemString - - - ]
[ *l + + + "*propagate_edges_at_term*" DemString - - - ].
CppTerm = "$" .
Normal = .
TermRef : LocalRef | ModuleRef.
ModuleRef : CompRef | LibRef *common* DemIdent.
LocalRef = .
CompRef = "@".
LibRef = "@@".
Optional_term = "[" Sandwich(Opt_labeled_term) "]".
/////////////////////////////////////////////////////////////////////////////////////
// for SCC computation
/////////////////////////////////////////////////////////////////////////////////////
SCC_component = + + + "*scc*" DemNumber DemString *l
List(SCC_component_Edges) - - - .
SCC_component_Edges = "*sccedge*" DemNumber DemString *l .
/////////////////////////////////////////////////////////////////////////////////////
// propagation patterns
/////////////////////////////////////////////////////////////////////////////////////
Propagation_patterns = [ CppCode ]
List (Propagation_pattern)
[ "*C*" CppCode ]
["*cd*" Cd_graph ] //for implementation
.
Propagation_pattern = Header
[ Meta_def ]
Impl_or_loc.
Meta_def = + "*constraints*" *l Meta_macro_def "*end*" - *l .
Meta_macro_def = [ + "*classes*" Commalist(Term) - *l ]
[ + "*edge*" "*patterns*" Commalist(Meta_edge) - *l ]
[ + "*class-set*" *l + Amplist(Class_set_def) - - *l ]
[ + "*directives*" *l + Amplist(Dir_meta_def) - - *l ].
Class_set_def = Class_set_def_name
"=" Vertex_selector ";" .
Class_set_def_name = DemIdent.
Dir_meta_def = Dir_def_name
"=" Propagation_directive_exp ";" .
Dir_def_name = DemIdent.
Impl_or_loc : Implementation | Pp_location.
Pp_location = + File_name - *l.
Header = Signature
[ + "*access*" Vertex_selector - *l ] .
Signature = *l "*operation*"
Type_spec
Op_name
"(" [ Commalist(Param_decl) ] ")"
[ Const ]
[ "*init*" CppCode ] *l .
CppCode = DemText.
Op_name = DemIdent.
Type_spec : Void | Nonvoid_type_spec.
Void = "void".
Nonvoid_type_spec : Type_with_attribute | Type_without_attribute.
Type_without_attribute = Type.
Type_with_attribute = Param_attribute
Type.
Param_attribute : In | Out | Inout.
In = "*in*".
Out = "*out*".
Inout = "*inout*".
Param_decl = Nonvoid_type_spec
Param_name
[ "=" CppCode ].
Param_name = DemIdent.
Type = [ Type_qualifier ]
Term
List(Ref_Ptr).
Ref_Ptr : Ref | Ptr.
Ref = "&".
Ptr = "*".
Type_qualifier : Const | Struct .
Const = "const".
Struct = "struct".
Implementation = [ + "*traverse*" *l + Propagation_directive_exp - - *l ]
List(Carry_or_wrapper).
Carry_or_wrapper : Sig_ext_prim | Code_fragment.
Sig_ext_prim = + "*carry*" Commalist(Param_decl) *l
+ "*along*" Propagation_directive_exp - *l
+ List(Param_assignment_block) - - *l.
Param_assignment_block = "*at*" [ PrefixAssign ] Vertex_selector *l
List(Param_assignment).
PrefixAssign = "*prefix*".
Param_assignment = + Param_name "=" CppCode - *l .
Impl_param_assignment = + Param_name [ CppCode ] - *l .
Code_fragment = + "*wrapper*" Vertices_edges *l
[ + "*prefix*" Prefix - *l ]
[ + + CppCode - - *l ]
[ + "*suffix*" *l + CppCode - - *l ]
-.
Prefix = .
////////////////////////////////////////////////////////////////////////
// propagation directive expressions
////////////////////////////////////////////////////////////////////////
Propagation_directive_exp : Pde | Merge_pde | Join_pde | Dir_name_with_exp.
Dir_name_with_exp = DemIdent.
Merge_pde = "*merge*" "(" Propagation_directive_exp ","
Propagation_directive_exp
")".
Join_pde = "*join*" "(" Propagation_directive_exp ","
Propagation_directive_exp
")".
Pde = "*from*" Vertex_selector
[ Path_constraint_exp ]
List(Segment).
Segment = Targets
[ Path_constraint_exp ].
Targets = To_or_via
Vertex_selector .
To_or_via : To | Via | Tostop.
Via = "*via*".
To = "*to*".
Tostop = "*to-stop*".
Path_constraint_exp : Require_through | Require_bypassing.
Require_through = Through_path_constraint
[ Bypassing_path_constraint ].
Require_bypassing = Bypassing_path_constraint
[ Through_path_constraint ].
Through_path_constraint = "*through*" Commalist(Meta_edge).
Bypassing_path_constraint = "*bypassing*" Commalist(Meta_edge).
Vertices_edges : Require_vertex_selector | Require_meta_edges.
Require_vertex_selector = Vertex_selector
[ Meta_edges ].
Require_meta_edges = Meta_edges
[ Vertex_selector ].
Meta_edges = Commalist(Meta_edge).
Meta_edge : Meta_construction_edge | Meta_alternation_edge |
Meta_repetition_edge | Meta_inheritance_edge.
Meta_construction_edge = "->" Vertex_selector ","
Label_selector ","
Vertex_selector .
Meta_alternation_edge = "=>" Vertex_selector ","
Vertex_selector .
Meta_inheritance_edge = ":>" Vertex_selector ","
Vertex_selector .
Meta_repetition_edge = "~>" Vertex_selector ","
Vertex_selector .
Macro_exp = "*expand*" .
Vertex_selector : Any_term | Fixed_term | Vertex_set.
Any_term = "*".
Fixed_term = Term.
Vertex_set : Vertex_set_sim | Vertex_set_comp | Class_set_inst | Late_selected_terms.
Vertex_set_sim = "{" Commalist(Fixed_term) "}" .
Vertex_set_comp = Vertex_set_op Vertex_set Vertex_set ")".
Vertex_set_op : Union | Intersect.
Union = "*union*" "(".
Intersect = "*intersect*" "(".
Class_set_inst = Class_set_name.
Late_selected_terms = "(*class-set*" Propagation_directive_exp ")".
Label_selector : Any_edge_label | Relation_meta_var | Label_set.
Label_set = "{" Commalist(Relation_meta_var) "}".
Any_edge_label = "*".
Relation_meta_var = DemIdent.
/////////////////////////////////////////////////////////////////////////////////
// parameterized classes
/////////////////////////////////////////////////////////////////////////////////
List(S) ~ {S}.
Nlist(S) ~ S { *l S} *l .
Barlist(S) ~ S {"|" *l S}.
Commalist(S) ~ S {"," S}.
Amplist(S) ~ S { *l S } .
Sandwich(S) =
List(Syntax_vertex) S
List(Syntax_vertex)
.