Пример #1
0
 public Conditional(Token conditionalType, Ast predicate, ScopeDeclr body, Conditional alternate = null)
     : this(conditionalType)
 {
     Predicate = predicate;
     Body = body;
     Alternate = alternate;
 }
Пример #2
0
 public Conditional(Token conditionalType, Ast predicate, ScopeDeclr body, Conditional alternate = null)
     : this(conditionalType)
 {
     Predicate = predicate;
     Body      = body;
     Alternate = alternate;
 }
Пример #3
0
        public ForLoop(Ast init, Ast stop, Ast modify, ScopeDeclr body)
            : base(new Token(TokenType.For))
        {
            Setup = init;

            Predicate = stop;

            Update = modify;

            Body = body;
        }
Пример #4
0
        public ForLoop(Ast init, Ast stop, Ast modify, ScopeDeclr body)
            : base(new Token(TokenType.For))
        {
            Setup = init;

            Predicate = stop;

            Update = modify;

            Body = body;
        }
Пример #5
0
        public MethodDeclr(Token returnType, Token funcName, List<Ast> arguments, ScopeDeclr body, bool isAnon = false)
            : base(funcName)
        {
            MethodReturnType = new Expr(returnType);

            MethodName = new Expr(funcName);

            Arguments = arguments;

            Body = body;

            IsAnonymous = isAnon;
        }
Пример #6
0
        public MethodDeclr(Token returnType, Token funcName, List <Ast> arguments, ScopeDeclr body, bool isAnon = false)
            : base(funcName)
        {
            MethodReturnType = new Expr(returnType);

            MethodName = new Expr(funcName);

            Arguments = arguments;

            Body = body;

            IsAnonymous = isAnon;
        }
Пример #7
0
 public ClassAst(Token token, ScopeDeclr body) : base(token)
 {
     Body = body;
 }
 public void Visit(ScopeDeclr ast)
 {
     Exec(ast);
 }
        private void ScopeDelcaration(ScopeDeclr ast)
        {
            MemorySpaces.CreateScope();

            ast.ScopedStatements.ForEach(statement => statement.Visit(this));

            MemorySpaces.PopScope();
        }
Пример #10
0
 public void Visit(ScopeDeclr ast)
 {
     PrintWrap("Scope", () => ast.ScopedStatements.ForEach(statement => statement.Visit(this)), true);
 }
Пример #11
0
 public TryCatchAst(ScopeDeclr tryBody, ScopeDeclr catchBody) : base(new Token(TokenType.Try))
 {
     TryBody   = tryBody;
     CatchBody = catchBody;
 }
Пример #12
0
 public LambdaDeclr(List<Ast> arguments, ScopeDeclr body )
     : base(new Token(TokenType.Infer), new Token(TokenType.Word, AnonymousFunctionName), arguments, body, true)
 {
 }
Пример #13
0
 public TryCatchAst(ScopeDeclr tryBody, ScopeDeclr catchBody)
     : base(new Token(TokenType.Try))
 {
     TryBody = tryBody;
     CatchBody = catchBody;
 }
Пример #14
0
 public WhileLoop(Ast predicate, ScopeDeclr body)
     : this(new Token(TokenType.While))
 {
     Predicate = predicate;
     Body      = body;
 }
        public void Visit(ScopeDeclr ast)
        {
            ScopeTree.CreateScope();

            ast.ScopedStatements.ForEach(statement => statement.Visit(this));

            SetScope(ast);

            ScopeTree.PopScope();
        }
Пример #16
0
 public ClassAst(Token token, ScopeDeclr body)
     : base(token)
 {
     Body = body;
 }
Пример #17
0
 public WhileLoop(Ast predicate, ScopeDeclr body)
     : this(new Token(TokenType.While))
 {
     Predicate = predicate;
     Body = body;
 }
Пример #18
0
 public LambdaDeclr(List <Ast> arguments, ScopeDeclr body)
     : base(new Token(TokenType.Infer), new Token(TokenType.Word, AnonymousFunctionName), arguments, body, true)
 {
 }