Changeset d484a32 for src/dgp/grammar.hh
- Timestamp:
- 10/24/14 13:07:15 (10 years ago)
- Branches:
- master
- Children:
- acbabee
- Parents:
- 56c300b
- git-author:
- Tomasz Obrebski <obrebski@…> (10/24/14 13:07:15)
- git-committer:
- Tomasz Obrebski <obrebski@…> (10/24/14 13:07:15)
- File:
-
- 1 edited
Legend:
- Unmodified
- Added
- Removed
-
src/dgp/grammar.hh
r519eaf5 rd484a32 27 27 struct Link 28 28 { 29 Link(Role r, Flag dfplus="NULL", Flag dfminus="NULL") : role(r), dflagplus(dfplus), dflagminus(dfminus) { }30 Link(Role r, PropSet ps=EmptyPropSet, Flag hfp="NULL", Flag hfm="NULL", Flag dfp="NULL", Flag dfm="NULL" )29 // Link(Role r, Flag dfplus="NULL", Flag dfminus="NULL") : role(r), dflagplus(dfplus), dflagminus(dfminus) { } 30 Link(Role r, PropSet ps=EmptyPropSet, Flag hfp="NULL", Flag hfm="NULL", Flag dfp="NULL", Flag dfm="NULL", int lineno=0) 31 31 : role(r), props(ps), hflagplus(hfp), hflagminus(hfm), dflagplus(dfp), dflagminus(dfm) { } 32 32 //Link(Role r) : role(r), dflagplus("NULL") { } … … 38 38 Flag dflagminus; 39 39 PropSet props; 40 int lineno; 40 41 41 42 bool operator<(const Link& l) const … … 67 68 Grammar() {} ; 68 69 69 Roles& connectable(Cat h, Cat d);70 Roles connectable(Cat h, Cat d, FlagSet f, FlagSet df);71 72 70 list<const Link*> connectable2(Cat h, Cat d, FlagSet hfs, FlagSet dfs); 73 71 … … 109 107 vector< FlagSet > pass; //[Role] 110 108 111 vector< vector< Roles > > connect; //[Cat][Cat]109 // vector< vector< Roles > > connect; //[Cat][Cat] 112 110 113 111 vector< vector< Links > > connect1; //[Cat][Cat] … … 143 141 // void set_connect(Cat c, Cat d, Flag f, Role r) { connect1[c][d].insert(Link(r,f)); } 144 142 145 void set_connect(Cat h, Flag hfp, Flag hfm, Cat d, Flag dfp, Flag dfm, Role r, PropSet ps ) { connect1[h][d].insert(Link(r,ps,hfp,hfm,dfp,dfm)); }143 void set_connect(Cat h, Flag hfp, Flag hfm, Cat d, Flag dfp, Flag dfm, Role r, PropSet ps, int lineno ) { connect1[h][d].insert(Link(r,ps,hfp,hfm,dfp,dfm,lineno)); } 146 144 147 145 void set_include(Role r, Role s) { include[r].set(s); } … … 160 158 161 159 inline 162 Roles& Grammar::connectable(Cat h, Cat d)163 {164 return connect[h][d];165 }166 167 //----------------------------------------------------------------------------------------------------168 169 inline170 Roles Grammar::connectable(Cat h, Cat d, FlagSet hfs, FlagSet dfs) // ZBYT WOLNE!!!!!!!!!!!!!!!!!!!!!!!!!! (-> Roles&)171 {172 Roles ret;173 for(Links::const_iterator l = connect1[h][d].begin(); l != connect1[h][d].end(); l++)174 if( (l->hflagplus==0 || hfs[l->hflagplus]) && (l->hflagminus==0 || !hfs[l->hflagminus]) )175 if( (l->dflagplus==0 || dfs[l->dflagplus]) && (l->dflagminus==0 || !dfs[l->dflagminus]) )176 ret.insert(l->role);177 return ret;178 }179 180 //----------------------------------------------------------------------------------------------------181 182 inline183 160 list<const Link*> Grammar::connectable2(Cat h, Cat d, FlagSet hfs, FlagSet dfs) // ZBYT WOLNE!!!!!!!!!!!!!!!!!!!!!!!!!! (-> Roles&) 184 161 { … … 190 167 return ret; 191 168 } 192 193 //----------------------------------------------------------------------------------------------------194 195 // inline196 // bool Grammar::check_constr(NodeProp& hprop, NodeProp& dprop, int dir, Role role) // dir: 0-left 1-right197 // {198 // return199 // !hprop.forbidden[role] &&200 // ( dir==1 || !right[role] ) &&201 // ( dir==0 || !left[role] ) &&202 // ( dir==1 || (hprop.attached&init).none() ) &&203 // ( dir==0 || (hprop.attached&fin).none() )204 // ;205 // }206 169 207 170 //----------------------------------------------------------------------------------------------------
Note: See TracChangeset
for help on using the changeset viewer.