Mercurial > projects > dang
diff src/parser/Action.d @ 209:42e663451371
Renamed some of the actions. Declarations now have it's own action.
author | Anders Johnsen <skabet@gmail.com> |
---|---|
date | Tue, 12 Aug 2008 19:05:17 +0200 |
parents | e0551773a005 |
children |
line wrap: on
line diff
--- a/src/parser/Action.d Tue Aug 12 18:21:06 2008 +0200 +++ b/src/parser/Action.d Tue Aug 12 19:05:17 2008 +0200 @@ -163,14 +163,42 @@ } /** - Either we should have one case that handles a lot of things, or we should - have a lot of separate cases. - As an example, this method could handle the params in `int f(int, int)` - as well as handling `int x` at both top-level, in classes and in methods. - - The other solution is an addParamToFunc or similar. + Called when an simple variable had been parsed. + */ + DeclT actOnVarDecl(ref Id type, ref Id name, + ExprT initializer, Attribute att) + { + return null; + } + + /** + Called when a struct has been parsed. + + actOnStructMember will be called for all members */ - DeclT actOnDeclarator(ref Id type, ref Id name, ExprT init, Attribute att) + DeclT actOnStructDecl(ref Id name, Attribute att) + { + return null; + } + + /** + Called when a class has been parsed. + + actOnClassMember will be called for all members + actOnClassBaseClass will be called for all base classes + */ + DeclT actOnClassDecl(ref Id name, Attribute att) + { + return null; + } + + /** + Called when a interface has been parsed. + + actOnInterfaceMember will be called for all members + actOnInterfaceBaseClass will be called for all base classes + */ + DeclT actOnInterfaceDecl(ref Id name, Attribute att) { return null; } @@ -366,14 +394,6 @@ } /** - This is called when strings are used in expression - */ - ExprT actOnStringExp(Token t) - { - return null; - } - - /** Unary operator. */ ExprT actOnUnaryOp(Token op, ExprT operand)