Esempio n. 1
0
 public Type( Type BaseClass, CodeBlock Code )
     : this(BaseClass, Code.Value)
 {
 }
Esempio n. 2
0
 public Type( CodeBlock Code )
     : base(Code.Value)
 {
     Identifiers = new Scope();
     Type = CodeBlockType.Type;
 }
Esempio n. 3
0
 public Loop(CodeBlock Condition, CodeBlock Block)
     : base(Block.Value)
 {
     condition = Condition;
     Type = CodeBlockType.Loop;
 }
Esempio n. 4
0
        public override Value Operate( Value First, Value Second )
        {
            if ( First is Reference ) First = ( First as Reference ).ReferencingValue;
            if ( Second is Reference ) Second = ( Second as Reference ).ReferencingValue;

            if ( First is Boolean ) First = new CodeBlock( new[] { First as Token }.ToList() );
            if ( First is Expression ) First = new CodeBlock( First as Expression );
            if ( First is CodeBlock && Second is CodeBlock )
            {
                return new Loop( First as CodeBlock, Second as CodeBlock );
            }
            throw new Exception( "Operands must be code blocks" );
        }
Esempio n. 5
0
 public Value CompileTimeOperate( Value First, Value Second )
 {
     if ( First is Expression ) First = new CodeBlock( First as Expression );
     if ( First is CodeBlock && Second is CodeBlock )
     {
         return new Loop( First as CodeBlock, Second as CodeBlock );
     }
     return NoValue.Value;
 }
Esempio n. 6
0
 public Function(List Arguments, CodeBlock Code, Scope Scope)
     : this(Arguments.GetValues().ConvertAll(X => X as String), Code.Value, Scope)
 {
 }