Commit d82f5e47 authored by Sarah Spall's avatar Sarah Spall Committed by Vikram Narayanan

finished writing, besides indentation, untested

parent 664628a4
This diff is collapsed.
...@@ -738,7 +738,7 @@ class CCSTExpression : public CCSTBase ...@@ -738,7 +738,7 @@ class CCSTExpression : public CCSTBase
<expression> ::= <assignment-expression> <expression> ::= <assignment-expression>
| <expression> , <assignment-expression> | <expression> , <assignment-expression>
*/ */
vector<CCSTAssignExpr> assn_exprs_; vector<CCSTAssignExpr*> assn_exprs_;
public: public:
CCSTExpression(vector<CCSTAssignExpr> assn){this->assn_exprs = assn;} CCSTExpression(vector<CCSTAssignExpr> assn){this->assn_exprs = assn;}
virtual void write(); virtual void write();
...@@ -807,7 +807,7 @@ class CCSTTypeName : public CCSTBase ...@@ -807,7 +807,7 @@ class CCSTTypeName : public CCSTBase
/* /*
<type-name> ::= {<specifier-qualifier>}+ {<abstract-declarator>}? <type-name> ::= {<specifier-qualifier>}+ {<abstract-declarator>}?
*/ */
vector<CCSTSpecifierQual> spec_quals_; vector<CCSTSpecifierQual*> spec_quals_;
CCSTAbstDeclarator *abs_dec_; CCSTAbstDeclarator *abs_dec_;
public: public:
CCSTTypeName(vector<CCSTSpecifierQual spec_quals, CCSTAbstDeclarator *abs_dec){this->spec_quals_ = spec_quals; this->abs_dec_ = abs_dec;} CCSTTypeName(vector<CCSTSpecifierQual spec_quals, CCSTAbstDeclarator *abs_dec){this->spec_quals_ = spec_quals; this->abs_dec_ = abs_dec;}
...@@ -847,13 +847,13 @@ class CCSTParamDeclaration : public CCSTParamList ...@@ -847,13 +847,13 @@ class CCSTParamDeclaration : public CCSTParamList
| {<declaration-specifier>}+ <abstract-declarator> | {<declaration-specifier>}+ <abstract-declarator>
| {<declaration-specifier>}+ | {<declaration-specifier>}+
*/ */
vector<CCSTDecSpecifier> dec_specs_; vector<CCSTDecSpecifier*> dec_specs_;
CCSTDeclarator *dec_; CCSTDeclarator *dec_;
CCSTAbstDeclarator *abs_dec_; CCSTAbstDeclarator *abs_dec_;
public: public:
CCSTParamDeclaration(vector<CCSTDecSpecifier> dec_specs){this->dec_specs_ = dec_specs;} CCSTParamDeclaration(vector<CCSTDecSpecifier*> dec_specs){this->dec_specs_ = dec_specs;}
CCSTParamDeclaration(vector<CCSTDecSpecifier> dec_specs, CCSTDeclarator *dec){this->dec_specs_ = dec_specs; this->dec_ = dec; this->abs_dec_ = abs_dec;} CCSTParamDeclaration(vector<CCSTDecSpecifier*> dec_specs, CCSTDeclarator *dec){this->dec_specs_ = dec_specs; this->dec_ = dec; this->abs_dec_ = abs_dec;}
CCSTParamDeclaration(vector<CCSTDecSpecifier> dec_specs, CCSTAbstDeclarator *abs_dec){this->dec_specs_ = dec_specs; this->abs_dec_ = abs_dec; this->dec_ = dec;} CCSTParamDeclaration(vector<CCSTDecSpecifier*> dec_specs, CCSTAbstDeclarator *abs_dec){this->dec_specs_ = dec_specs; this->abs_dec_ = abs_dec; this->dec_ = dec;}
virtual void write(); virtual void write();
}; };
...@@ -913,7 +913,7 @@ class CCSTEnumeratorList : public CCSTBase ...@@ -913,7 +913,7 @@ class CCSTEnumeratorList : public CCSTBase
<enumerator-list> ::= <enumerator> <enumerator-list> ::= <enumerator>
| <enumerator-list> , <enumerator> | <enumerator-list> , <enumerator>
*/ */
vector<CCSTEnumerator> list_; vector<CCSTEnumerator*> list_;
public: public:
CCSTEnumeratorList(vector<CCSTEnumerator> list){this->list_ = list;} CCSTEnumeratorList(vector<CCSTEnumerator> list){this->list_ = list;}
virtual void write(); virtual void write();
...@@ -948,10 +948,10 @@ class CCSTDeclaration : public CCSTExDeclaration ...@@ -948,10 +948,10 @@ class CCSTDeclaration : public CCSTExDeclaration
<declaration> ::= {<declaration-specifier>}+ {<init-declarator>}* <declaration> ::= {<declaration-specifier>}+ {<init-declarator>}*
*/ */
vector<CCSTDecSpecifier> dec_spec_; vector<CCSTDecSpecifier*> dec_spec_;
CCSTInitDeclarator *init_dec_; vector<CCSTInitDeclarator*> init_dec_;
public: public:
CCSTDeclaration(vector<CCSTDecSpecifier> dec_spec, CCSTInitDeclarator *init_dec){this->dec_spec_ = dec_spec; this->init_dec_ = init_dec;} CCSTDeclaration(vector<CCSTDecSpecifier> dec_spec, vector<CCSTInitDeclarator*> init_dec){this->dec_spec_ = dec_spec; this->init_dec_ = init_dec;}
virtual void write(); virtual void write();
}; };
...@@ -979,8 +979,10 @@ class CCSTInitializer : public CCSTInitializerList ...@@ -979,8 +979,10 @@ class CCSTInitializer : public CCSTInitializerList
| { <initializer-list> , } | { <initializer-list> , }
*/ */
CCSTAssignExpr *assn_expr_; CCSTAssignExpr *assn_expr_;
CCSTInitializerList *init_list_;
public: public:
CCSTInitializer(CCSTAssignExpr *assn_expr){this->assn_expr_ = assn_expr;} CCSTInitializer(CCSTAssignExpr *assn_expr){this->assn_expr_ = assn_expr;}
CCSTInitializer(CCSTInitializerList *init_list){this->init_list_ = init_list;}
virtual void write(); virtual void write();
}; };
...@@ -1002,8 +1004,8 @@ class CCSTCompoundStatement : public CCSTStatement ...@@ -1002,8 +1004,8 @@ class CCSTCompoundStatement : public CCSTStatement
<compound-statement> ::= { {<declaration>}* {<statement>}* } <compound-statement> ::= { {<declaration>}* {<statement>}* }
*/ */
// is this a body? // is this a body?
vector<CCSTDeclaration> declarations_; vector<CCSTDeclaration*> declarations_;
vector<CCSTStatement> statements_; vector<CCSTStatement*> statements_;
public: public:
CCSTCompoundStatement(vector<CCSTDeclaration> decs, vector<CCSTStatement> s){this->declarations_ = decs; this->statements_ = s;} CCSTCompoundStatement(vector<CCSTDeclaration> decs, vector<CCSTStatement> s){this->declarations_ = decs; this->statements_ = s;}
virtual void write(); virtual void write();
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment