{[ promptMessage ]}

Bookmark it

{[ promptMessage ]}

lab2part2 - | Concrete Template Statement_Kernel_1#ifndef...

Info iconThis preview shows pages 1–3. Sign up to view the full content.

View Full Document Right Arrow Icon
// /*-------------------------------------------------------------------*\ // | Concrete Template : Statement_Kernel_1 // \*-------------------------------------------------------------------*/ #ifndef CT_STATEMENT_KERNEL_1 #define CT_STATEMENT_KERNEL_1 1 ///------------------------------------------------------------------------ /// Global Context -------------------------------------------------------- ///------------------------------------------------------------------------ #include "AT/Statement/Kernel.h" #include "CT/Tree/Kernel_1a.h" ///------------------------------------------------------------------------ /// Interface ------------------------------------------------------------- ///------------------------------------------------------------------------ concrete_template < concrete_instance class Nested_Statement_Type, /*! implements abstract_instance Statement_Kernel < Nested_Statement_Type > !*/ concrete_instance class Tree_Node = Record < Integer, Integer, Text >, concrete_instance class Tree_Of_Tree_Node = Tree_Kernel_1a <Tree_Node>, concrete_instance class Rep = Representation < Tree_Of_Tree_Node > > class Statement_Kernel_1 : implements abstract_instance Statement_Kernel <Nested_Statement_Type>, encapsulates concrete_instance Rep { private: rep_field_name (Rep, 0, Tree_Of_Tree_Node, tree_rep); field_name (Tree_Node, 0, Integer, kind); field_name (Tree_Node, 1, Integer, test); field_name (Tree_Node, 2, Text, instruction); /*! math definition IS_LEGAL_LABEL ( k: integer t: integer i: string of character ): boolean is k is in Kind and t is in Condition and IS_IDENTIFIER (i) and IS_STATEMENT_LABEL (k, t, i)
Background image of page 1

Info iconThis preview has intentionally blurred sections. Sign up to view the full version.

View Full Document Right Arrow Icon
math definition ALL_LABELS_ARE_LEGAL ( t: tree of Tree_Node ): boolean satisfies there exists label: Tree_Node, subtrees: string of tree of Tree_Node (t = compose (label, subtrees) and IS_LEGAL_LABEL (label.kind, label.test, label.instruction) and for all x: tree of Tree_Node where (x is in elements (subtrees)) (ALL_LABELS_ARE_LEGAL (x))) convention ALL_LABELS_ARE_LEGAL (self.tree_rep) and IS_LEGAL_STATEMENT (self.tree_rep) correspondence self = self.tree_rep
Background image of page 2
Image of page 3
This is the end of the preview. Sign up to access the rest of the document.

{[ snackBarMessage ]}