示例#1
0
 public virtual object Walk(LoadStatement node)
 {
     if (Enter(node))
     {
         node.CodeFile.Accept(this);
     }
     Exit(node);
     return(null);
 }
示例#2
0
        private LoadStatement ParseLoadStatement()
        {
            var import = new LoadStatement {
                Token = Next()
            };

            Match(TokenType.Load);
            import.CodeFile = ParseAssignmentExpression();
            Match(TokenType.SemiColon);
            return(import);
        }
示例#3
0
        public override object Walk(LoadStatement node)
        {
            var file = node.CodeFile.Accept(this);

            if (!(file is BikeString))
            {
                throw ErrorFactory.CreateTypeError("'load' works only with string type");
            }

            var path = ((BikeString)file).Value;

            if (string.IsNullOrWhiteSpace(path))
            {
                throw ErrorFactory.CreateLoadError(path);
            }

            if (Path.GetExtension(path).ToUpperInvariant() == ".BK")
            {
                return(LoadAndExecute(path));
            }
            Context.ImportAssembly(path);
            return(null);
        }
示例#4
0
 public override void Exit(LoadStatement node)
 {
     level--;
 }
示例#5
0
 public override bool Enter(LoadStatement node)
 {
     Print("ReferenceStatement");
     level++;
     return true;
 }
示例#6
0
 public virtual void Exit(LoadStatement node)
 {
 }
示例#7
0
 public virtual bool Enter(LoadStatement node)
 {
     return true;
 }
 public virtual void Exit(LoadStatement node)
 {
 }
 public virtual bool Enter(LoadStatement node)
 {
     return(true);
 }
示例#10
0
 public override void Exit(LoadStatement node)
 {
     level--;
 }
示例#11
0
 public override bool Enter(LoadStatement node)
 {
     Print("ReferenceStatement");
     level++;
     return(true);
 }
示例#12
0
        public override object Walk(LoadStatement node)
        {
            var file = node.CodeFile.Accept(this);
            if (!(file is BikeString))
                throw ErrorFactory.CreateTypeError("'load' works only with string type");

            var path = ((BikeString)file).Value;
            if (string.IsNullOrWhiteSpace(path))
                throw ErrorFactory.CreateLoadError(path);

            if (Path.GetExtension(path).ToUpperInvariant() == ".BK")
            {
                return LoadAndExecute(path);
            }
            Context.ImportAssembly(path);
            return null;
        }
示例#13
0
文件: Parser.cs 项目: buunguyen/bike
 private LoadStatement ParseLoadStatement()
 {
     var import = new LoadStatement { Token = Next() };
     Match(TokenType.Load);
     import.CodeFile = ParseAssignmentExpression();
     Match(TokenType.SemiColon);
     return import;
 }
示例#14
0
 public virtual object Walk(LoadStatement node)
 {
     if (Enter(node))
     {
         node.CodeFile.Accept(this);
     }
     Exit(node);
     return null;
 }