| 204 | return new AST::IntVar(0); // keep things consistent |
| 205 | } |
| 206 | AST::Node* getVarRefArg(ParserState* pp, string id, bool annotation = false) { |
| 207 | SymbolEntry e; |
| 208 | string n; |
| 209 | if (annotation) |
| 210 | n = id; |
| 211 | if (pp->symbols.get(id, e)) { |
| 212 | switch (e.t) { |
| 213 | case ST_INTVAR: return new AST::IntVar(e.i,n); |
| 214 | case ST_BOOLVAR: return new AST::BoolVar(e.i,n); |
| 215 | case ST_SETVAR: return new AST::SetVar(e.i,n); |
| 216 | case ST_FLOATVAR: return new AST::FloatVar(e.i,n); |
| 217 | default: break; |
| 218 | } |
| 219 | } |
| 220 | |
| 221 | if (annotation) |
| 222 | return new AST::Atom(id); |
| 223 | pp->err << "Error: undefined variable " << id |
| 224 | << " in line no. " |
| 225 | << yyget_lineno(pp->yyscanner) << std::endl; |
| 226 | pp->hadError = true; |
| 227 | return new AST::IntVar(0); // keep things consistent |
| 228 | } |
| 229 | |
| 230 | void addDomainConstraint(ParserState* pp, std::string id, AST::Node* var, |
| 231 | Option<AST::SetLit* >& dom) { |
no test coverage detected