Пример #1
0
        public virtual void BuildAst(LanguageData language, ParseTree parseTree)
        {
            if (!LanguageFlags.IsSet(LanguageFlags.CreateAst))
            {
                return;
            }
            var astContext = new AstContext(language);
            var astBuilder = new AstBuilder(astContext);

            astBuilder.BuildAst(parseTree);
        }
Пример #2
0
        /// <summary>Builds the AST for the specified language data and parse tree.</summary>
        /// <param name="language">The language data.</param>
        /// <param name="parseTree">The parse tree to build the AST against.</param>
        public override void BuildAst(LanguageData language, ParseTree parseTree)
        {
            if (!LanguageFlags.IsSet(LanguageFlags.CreateAst))
            {
                return;
            }

            var astContext = new InterpreterAstContext(language, _OperatorHandler);

            astContext.DefaultNodeType = typeof(NotSupportedNode);
            var astBuilder = new AstBuilder(astContext);

            astBuilder.BuildAst(parseTree);
        }
Пример #3
0
        public override void BuildAst(LanguageData language, ParseTree parseTree)
        {
            if (LanguageFlags.IsSet(LanguageFlags.CreateAst))
            {
                var astContext = new AstContext(language);
                astContext.DefaultNodeType           = typeof(DefaultAstNode);
                astContext.DefaultLiteralNodeType    = typeof(DefaultAstNode);
                astContext.DefaultIdentifierNodeType = typeof(DefaultAstNode);


                var astBuilder = new AstBuilder(astContext);
                astBuilder.BuildAst(parseTree);
            }
        }