comparison parser/Parser.d @ 194:08f68d684047

Rename some files. Hopefully we can get a more iterative sema pass, that's a lot easier to "get startet with". Also added support for alias.
author Anders Johnsen <skabet@gmail.com>
date Tue, 29 Jul 2008 13:54:44 +0200
parents 85e492318bb6
children
comparison
equal deleted inserted replaced
193:658178183018 194:08f68d684047
88 88
89 case Tok.Interface: 89 case Tok.Interface:
90 Id type = Id(next()); 90 Id type = Id(next());
91 Id iden = Id(require(Tok.Identifier)); 91 Id iden = Id(require(Tok.Identifier));
92 return parseInterface(type, iden, att); 92 return parseInterface(type, iden, att);
93
94 case Tok.Alias:
95 next();
96 auto decl = parseDecl(Attribute());
97 return action.actOnAliasDecl(decl, att);
93 98
94 case Tok.Identifier: 99 case Tok.Identifier:
95 Id type = parseType; 100 Id type = parseType;
96 Id iden = Id(require(Tok.Identifier)); 101 Id iden = Id(require(Tok.Identifier));
97 102
124 goto case Tok.Identifier; 129 goto case Tok.Identifier;
125 130
126 messages.report(UnexpectedTok, peek.location) 131 messages.report(UnexpectedTok, peek.location)
127 .arg(sm.getText(peek.asRange)); 132 .arg(sm.getText(peek.asRange));
128 133
134 next();
129 return null; 135 return null;
130 } 136 }
131 messages.report(UnexpectedTok, peek.location) 137 messages.report(UnexpectedTok, peek.location)
132 .arg(peek.get(sm)) 138 .arg(peek.get(sm))
133 .arg(Tok.Identifier) 139 .arg(Tok.Identifier)
959 965
960 default: 966 default:
961 return iden; 967 return iden;
962 } 968 }
963 } 969 }
970 else if (n.type == Tok.Null)
971 return action.actOnNullExpr(n.location);
964 else if (n.type == Tok.Cast) 972 else if (n.type == Tok.Cast)
965 return parseCast(n); 973 return parseCast(n);
966 else if (n.type == Tok.Integer) 974 else if (n.type == Tok.Integer)
967 return action.actOnNumericConstant(n); 975 return action.actOnNumericConstant(n);
968 else if (n.type == Tok.String) 976 else if (n.type == Tok.String)