1 // Copyright 2004-2007 Castle Project - http://www.castleproject.org/
3 // Licensed under the Apache License, Version 2.0 (the "License");
4 // you may not use this file except in compliance with the License.
5 // You may obtain a copy of the License at
7 // http://www.apache.org/licenses/LICENSE-2.0
9 // Unless required by applicable law or agreed to in writing, software
10 // distributed under the License is distributed on an "AS IS" BASIS,
11 // WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
12 // See the License for the specific language governing permissions and
13 // limitations under the License.
15 namespace Castle
.Rook
.Compiler
.Visitors
19 using Castle
.Rook
.Compiler
.AST
;
21 public interface IASTVisitor
23 void VisitCompilationUnit(CompilationUnit compilationUnit
);
24 bool VisitSourceUnit(SourceUnit unit
);
28 bool VisitNamespace(NamespaceDescriptor ns
);
29 bool VisitEnter(NamespaceDescriptor ns
);
30 bool VisitLeave(NamespaceDescriptor ns
);
31 bool VisitTypeDefinitionStatement(TypeDefinitionStatement typeDef
);
32 bool VisitEnter(TypeDefinitionStatement typeDef
);
33 bool VisitLeave(TypeDefinitionStatement typeDef
);
34 bool VisitMethodDefinitionStatement(MethodDefinitionStatement methodDef
);
35 bool VisitEnter(MethodDefinitionStatement methodDef
);
36 bool VisitLeave(MethodDefinitionStatement methodDef
);
40 // bool VisitTypeReference(TypeReference reference);
41 // bool VisitIdentifier(Identifier identifier);
42 // bool VisitParameterIdentifier(ParameterIdentifier parameterIdentifier);
43 void VisitOpaqueIdentifier(OpaqueIdentifier opaqueIdentifier
);
44 void VisitParameterVarIdentifier(ParameterVarIdentifier varIdentifier
);
45 void VisitTypeReference(TypeReference reference
);
49 void VisitExpressionStatement(ExpressionStatement statement
);
50 void VisitConstructorDefinitionStatement(ConstructorDefinitionStatement statement
);
52 // bool VisitMultipleVariableDeclarationStatement(MultipleVariableDeclarationStatement varDecl);
53 // bool VisitRepeatStatement(RepeatStatement statement);
54 // bool VisitPostfixCondition(PostfixCondition postfixCondition);
55 // bool VisitSingleVariableDeclarationStatement(SingleVariableDeclarationStatement declarationStatement);
56 // bool VisitReturnStatement(ReturnStatement statement);
57 // bool VisitRequireStatement(RequireStatement statement);
61 void VisitMethodInvocationExpression(MethodInvocationExpression invocationExpression
);
62 void VisitVariableReferenceExpression(VariableReferenceExpression expression
);
63 void VisitConstExpression(ConstExpression expression
);
64 void VisitBlockExpression(BlockExpression expression
);
65 void VisitMemberAccessExpression(MemberAccessExpression accessExpression
);
67 // bool VisitAssignmentExpression(AssignmentExpression assignExp);
68 // bool VisitAugAssignmentExpression(AugAssignmentExpression auAssignExp);
69 // bool VisitYieldExpression(YieldExpression yieldExpression);
70 // bool VisitVariableReferenceExpression(VariableReferenceExpression variableReferenceExpression);
71 // bool VisitUnaryExpression(UnaryExpression unaryExpression);
72 // bool VisitRetryExpression(RetryExpression expression);
73 // bool VisitNextExpression(NextExpression expression);
74 // bool VisitRedoExpression(RedoExpression expression);
75 // bool VisitRangeExpression(RangeExpression rangeExpression);
76 // bool VisitRaiseExpression(RaiseExpression expression);
77 // bool VisitMethodInvocationExpression(MethodInvocationExpression invocationExpression);
78 // bool VisitMemberAccessExpression(MemberAccessExpression accessExpression);
79 // bool VisitLiteralReferenceExpression(LiteralReferenceExpression expression);
80 // bool VisitListExpression(ListExpression expression);
81 // bool VisitLambdaExpression(LambdaExpression expression);
82 // bool VisitIfStatement(IfStatement ifStatement);
83 // bool VisitForStatement(ForStatement statement);
84 // bool VisitExpressionStatement(ExpressionStatement statement);
85 // bool VisitDictExpression(DictExpression expression);
86 // bool VisitCompoundExpression(CompoundExpression expression);
87 // bool VisitBreakExpression(BreakExpression breakExpression);
88 // bool VisitBlockExpression(BlockExpression expression);
89 // bool VisitBinaryExpression(BinaryExpression expression);
90 // bool VisitTypeDeclarationExpression(TypeDeclarationExpression typeDeclarationExpression);
91 // bool VisitBaseReferenceExpression(BaseReferenceExpression expression);
92 // bool VisitSelfReferenceExpression(SelfReferenceExpression expression);
93 // bool VisitNullCheckExpression(NullCheckExpression expression);