public Conditional(Token conditionalType, Ast predicate, ScopeDeclr body, Conditional alternate = null)
     : this(conditionalType)
 {
     Predicate = predicate;
     Body = body;
     Alternate = alternate;
 }
Exemple #2
0
 public Conditional(Token conditionalType, Ast predicate, ScopeDeclr body, Conditional alternate = null)
     : this(conditionalType)
 {
     Predicate = predicate;
     Body      = body;
     Alternate = alternate;
 }
Exemple #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;
        }
Exemple #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;
        }
        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;
        }
        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;
        }
 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();
        }
 public void Visit(ScopeDeclr ast)
 {
     PrintWrap("Scope", () => ast.ScopedStatements.ForEach(statement => statement.Visit(this)), true);
 }
Exemple #11
0
 public TryCatchAst(ScopeDeclr tryBody, ScopeDeclr catchBody) : base(new Token(TokenType.Try))
 {
     TryBody   = tryBody;
     CatchBody = catchBody;
 }
 public LambdaDeclr(List<Ast> arguments, ScopeDeclr body )
     : base(new Token(TokenType.Infer), new Token(TokenType.Word, AnonymousFunctionName), arguments, body, true)
 {
 }
 public TryCatchAst(ScopeDeclr tryBody, ScopeDeclr catchBody)
     : base(new Token(TokenType.Try))
 {
     TryBody = tryBody;
     CatchBody = catchBody;
 }
 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();
        }
Exemple #16
0
 public ClassAst(Token token, ScopeDeclr body)
     : base(token)
 {
     Body = body;
 }
 public WhileLoop(Ast predicate, ScopeDeclr body)
     : this(new Token(TokenType.While))
 {
     Predicate = predicate;
     Body = body;
 }
Exemple #18
0
 public LambdaDeclr(List <Ast> arguments, ScopeDeclr body)
     : base(new Token(TokenType.Infer), new Token(TokenType.Word, AnonymousFunctionName), arguments, body, true)
 {
 }