bits { return BITS; }
string { return STRING; }
list { return LIST; }
+code { return CODE; }
class { return CLASS; }
def { return DEF; }
std::vector<SubClassRefTy> *SubClassList;
};
-%token INT BIT STRING BITS LIST CLASS DEF FIELD SET IN
+%token INT BIT STRING BITS LIST CODE CLASS DEF FIELD SET IN
%token <IntVal> INTVAL
%token <StrVal> ID STRVAL
$$ = new IntRecTy();
} | LIST '<' ClassID '>' { // list<x> type
$$ = new ListRecTy($3);
+ } | CODE { // code type
+ $$ = new CodeRecTy();
} | ClassID { // Record Type
$$ = new RecordRecTy($1);
};
void print(std::ostream &OS) const;
};
+/// CodeRecTy - 'code' - Represent an code fragment, function or method.
+///
+struct CodeRecTy : public RecTy {
+ Init *convertValue(UnsetInit *UI) { return (Init*)UI; }
+
+ void print(std::ostream &OS) const { OS << "code"; }
+};
+
+
/// RecordRecTy - '<classname>' - Represent an instance of a class, such as:
/// (R32 X = EAX).
///
bits { return BITS; }
string { return STRING; }
list { return LIST; }
+code { return CODE; }
class { return CLASS; }
def { return DEF; }
std::vector<SubClassRefTy> *SubClassList;
};
-%token INT BIT STRING BITS LIST CLASS DEF FIELD SET IN
+%token INT BIT STRING BITS LIST CODE CLASS DEF FIELD SET IN
%token <IntVal> INTVAL
%token <StrVal> ID STRVAL
$$ = new IntRecTy();
} | LIST '<' ClassID '>' { // list<x> type
$$ = new ListRecTy($3);
+ } | CODE { // code type
+ $$ = new CodeRecTy();
} | ClassID { // Record Type
$$ = new RecordRecTy($1);
};
void print(std::ostream &OS) const;
};
+/// CodeRecTy - 'code' - Represent an code fragment, function or method.
+///
+struct CodeRecTy : public RecTy {
+ Init *convertValue(UnsetInit *UI) { return (Init*)UI; }
+
+ void print(std::ostream &OS) const { OS << "code"; }
+};
+
+
/// RecordRecTy - '<classname>' - Represent an instance of a class, such as:
/// (R32 X = EAX).
///