public void Apply(Program node) { this.AST = node; if (this.AST == null) { ErrorManager.Add(new Error("Semantical Parser: Could not find the main program.", (0, 0))); this.AST = new Program((0, 0)); this.AST.Classes = new ClassList((0, 0)); this.AST.Functions = new FuncDefList((0, 0)); this.AST.MainFunction = new MainStatBlock(null); this.AST.Table = new SyntacticAnalyzer.Semantics.SymbolTable(); return; } // Generate the symbol tables. var symbolTableVisitor = new SymbolTableVisitor(); this.AST.Accept(symbolTableVisitor); var functionLinker = new FunctionLinkerVisitor(this.AST.Table); this.AST.Accept(functionLinker); var classInheriter = new InheritanceVisitor(this.AST.Table); this.AST.Accept(classInheriter); var typeVisitor = new TypeVisitor(this.AST.Table); this.AST.Accept(typeVisitor); }
public object TranslateExpression(Expression expression) { expression = Evaluator.PartialEval(expression); expression = new BinaryBooleanReducer().Visit(expression); expression = new AssociationVisitor((ISessionFactoryImplementor)session.SessionFactory).Visit(expression); expression = new InheritanceVisitor().Visit(expression); expression = CollectionAliasVisitor.AssignCollectionAccessAliases(expression); expression = new PropertyToMethodVisitor().Visit(expression); expression = new BinaryExpressionOrderer().Visit(expression); var translator = new NHibernateQueryTranslator(session, entityName); return(this.rootCriteria == null? translator.Translate(expression, this.queryOptions) : translator.Translate(expression, (ICriteria)this.rootCriteria.Clone())); }