///////////////////////////////////////////////////////////////////////////////////// // $Log: cd.cd,v $ // Revision 5.5.1.2 1994/08/30 14:29:49 demeter // *** empty log message *** // // Revision 5.5.1.1 1994/08/30 14:25:43 demeter // *** empty log message *** // // Revision 5.5 1994/08/30 14:25:42 demeter // *** empty log message *** // // Revision 5.4.1.3 1994/08/30 14:25:22 demeter // *** empty log message *** // // Revision 5.4.1.4 1994/02/25 21:39:02 demeter // restriction checking // // Revision 5.4.1.3 1994/02/24 20:52:21 demeter // reimplement object transportation -- cun // // Revision 5.4.1.2 1994/02/22 14:45:22 demeter // update according to the new semantics // ///////////////////////////////////////////////////////////////////////////////////// ///////////////////////////////////////////////////////////////////////////////////// // possible inputs ///////////////////////////////////////////////////////////////////////////////////// Demeter_in = Input. Input : Cd_graph // schema | Propagation_patterns // implementations of propagation patterns | Component // definition of a component | Instantiation | Propagation_schema . Propagation_schema = [ "*source*" Vertex_selector *l ] [ "*target*" Vertex_selector *l ] + "*paths*" *l + Cd_graph - - *l. ////////////////////////////////////////////////////////////////////////////////////// // component definition ////////////////////////////////////////////////////////////////////////////////////// Component = "*component*" Component_name *l [ + "*customizers*" Commalist(Schema_instance) - *l ] [ Meta_def ] [ + "*declare*" CppCode - *l ] [ + "*define*" CppCode - *l ] Provided_asset // definitions and declarations [ Required_asset ] "*end*" [ Component_name ]. Schema_instance : Schema_location | Schema. Schema = Cd_graph. 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 ] [ + "*macro*" Amplist(PCP_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. PCP_def = PCP_def_name "=" PCP ";" . PCP_def_name = DemIdent. PCP : Propagation_directive_exp // | Sig_ext_prim | Propagation_pattern. Asset : Provided_asset | Required_asset *common* Asset_declaration. Provided_asset = . Required_asset = "*require*". Asset_declaration = List(Pp_with_qualifier). Access_specifier : Public | Private. Public = "*public*". Private = "*private*". Pp_with_qualifier = [ Access_specifier ] Propagation_pattern. Component_name = DemIdent. Schema_location = File_name. Schema_name = DemIdent. File_name = DemString. ////////////////////////////////////////////////////////////////////////// // Instantiation ////////////////////////////////////////////////////////////////////////// Instantiation = "*build*" Instantiation_name "*schema*" Schema_instance [ Meta_def ] [ "*declare*" CppCode ] [ "*define*" CppCode ] "*main*" CppCode Pps Comps Inst_paths Ext_libs "*end*" [ Instantiation_name] . Pps = [ "*pp-path*" Nlist(Search_path) ] List(Propagation_pattern). Comps = [ "*comp-path*" Nlist(Search_path) ] List(Component_inst). Inst_paths = [ "*inst-path*" Nlist(Search_path) ]. Ext_libs = [ "*include*" Nlist(Search_path) ] [ "*lib*" Nlist(Search_path) ]. Rename = + "*rename*" Commalist(Each_renaming) "*end*" - *l . Search_path = DemString. Parsed_obj = Term "*" DemIdent. Instantiation_name = DemIdent. Component_inst = "*component*" Component_location [ Rename ] [ Meta_def ] . Meta_def = + "*constraints*" *l Meta_macro_def "*end*" - *l . Component_location : Component_name | Component_file. Component_file = File_name. Each_renaming = Name_inst "=>" Name_inst. Name_inst : Dir_name | Class_set_name | CRFV_name. 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 = "=". // This is the only difference from propagate/cd.cd // Alternat_ns = ":" *l [ + + + Barlist(Term) - - - ] Common. 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 . Meta_def_input = List(Meta_def). Rename_input = List(Rename). Propagation_pattern =
Header [ Rename ] [ Meta_def ] Impl_or_loc. 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. Merge_pde = "*merge*" "(" Propagation_directive_exp "," Propagation_directive_exp ")". Join_pde = "*join*" "(" Propagation_directive_exp "," Propagation_directive_exp ")". Dir_name_with_exp = DemIdent. 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) .