Exemple #1
0
 public override CodePiece GenerateCodeAssignment(CodeGenEnvironment env, SourceCodePosition pos, Expression source, ExpressionValuePointer target, bool reversed)
 {
     throw new InvalidAstStateException(pos);
 }
Exemple #2
0
 public WrongTypeException(SourceCodePosition pos, BType found, params BType[] expec)
     : base(String.Format("Wrong Type found: Found = {0}. Expected = {1}", found, string.Join(" or ", expec.ToList())), pos)
 {
 }
Exemple #3
0
 public InlineVoidMethodCallException(SourceCodePosition pos)
     : base("Call of an void-Method inside of a expression", pos)
 {
 }
Exemple #4
0
 public TerminalNode(string value, SourceCodePosition pos) : base(pos)
 {
     Value = value;
 }
Exemple #5
0
 public WrongParameterCountException(int actual, int expected, SourceCodePosition pos)
     : base(String.Format("Parametercount ({0}) differs from expected ({1})", actual, expected), pos)
 {
 }
Exemple #6
0
 public BTypeDigitArr(SourceCodePosition pos, int sz)
     : base(pos, sz)
 {
 }
Exemple #7
0
 public BTypeValue(SourceCodePosition pos)
     : base(pos)
 {
     //--
 }
Exemple #8
0
 public override CodePiece GenerateCodeWriteFromStackToGrid(CodeGenEnvironment env, SourceCodePosition pos, VarDeclarationPosition gridPos, bool reversed)
 {
     return(CodePieceStore.WriteArrayFromStack(env, gridPos, reversed));
 }
Exemple #9
0
 public override CodePiece GenerateCodeReadFromGridToStack(CodeGenEnvironment env, SourceCodePosition pos, VarDeclarationPosition gridPos, bool reversed)
 {
     return(CodePieceStore.ReadArrayToStack(env, gridPos, reversed));
 }
Exemple #10
0
 public BTypeStack(SourceCodePosition pos, int sz)
     : base(pos)
 {
     StackSize = sz;
 }
Exemple #11
0
 public override CodePiece GenerateCodePopValueFromStack(CodeGenEnvironment env, SourceCodePosition pos, bool reversed)
 {
     return(CodePieceStore.PopMultipleStackValues(StackSize + 1, reversed));
 }
Exemple #12
0
 public override CodePiece GenerateCodeReturnFromMethodCall(CodeGenEnvironment env, SourceCodePosition pos, Expression value, bool reversed)
 {
     throw new InvalidAstStateException(pos);
 }
Exemple #13
0
 public override CodePiece GenerateCodeReadFromGridToStack(CodeGenEnvironment env, SourceCodePosition pos, VarDeclarationPosition gridPos, bool reversed)
 {
     throw new InvalidAstStateException(pos);
 }
Exemple #14
0
 public override CodePiece GenerateCodePopValueFromStack(CodeGenEnvironment env, SourceCodePosition pos, bool reversed)
 {
     throw new InvalidAstStateException(pos);
 }
Exemple #15
0
 public abstract CodePiece GenerateCodeWriteFromStackToGrid(CodeGenEnvironment env, SourceCodePosition pos, VarDeclarationPosition gridPos, bool reversed);
Exemple #16
0
        public override CodePiece GenerateCodeReturnFromMethodCall(CodeGenEnvironment env, SourceCodePosition pos, Expression value, bool reversed)
        {
            CodePiece p = new CodePiece();

            if (reversed)
            {
                #region Reversed

                p.AppendLeft(value.GenerateCode(env, reversed));

                // Switch ReturnValue (Array)  and  BackJumpAddr

                p.AppendLeft(CodePieceStore.WriteArrayFromStack(env, env.TMP_ARRFIELD_RETURNVAL, reversed));
                p.AppendLeft(CodePieceStore.WriteValueToField(env.TMP_FIELD_JMP_ADDR, reversed));

                p.AppendLeft(CodePieceStore.ReadArrayToStack(env, env.TMP_ARRFIELD_RETURNVAL, reversed));
                p.AppendLeft(CodePieceStore.ReadValueFromField(env.TMP_FIELD_JMP_ADDR, reversed));

                p.AppendLeft(BCHelper.Digit0);                 // Right Lane

                p.AppendLeft(BCHelper.PC_Up_tagged(new MethodCallVerticalExitTag()));

                #endregion
            }
            else
            {
                #region Normal

                p.AppendRight(value.GenerateCode(env, reversed));

                // Switch ReturnValue (Array)  and  BackJumpAddr

                p.AppendRight(CodePieceStore.WriteArrayFromStack(env, env.TMP_ARRFIELD_RETURNVAL, reversed));
                p.AppendRight(CodePieceStore.WriteValueToField(env.TMP_FIELD_JMP_ADDR, reversed));

                p.AppendRight(CodePieceStore.ReadArrayToStack(env, env.TMP_ARRFIELD_RETURNVAL, reversed));
                p.AppendRight(CodePieceStore.ReadValueFromField(env.TMP_FIELD_JMP_ADDR, reversed));

                p.AppendRight(BCHelper.Digit0);                 // Right Lane

                p.AppendRight(BCHelper.PC_Up_tagged(new MethodCallVerticalExitTag()));

                #endregion
            }

            p.NormalizeX();
            return(p);
        }
Exemple #17
0
 public abstract CodePiece GenerateCodeReadFromGridToStack(CodeGenEnvironment env, SourceCodePosition pos, VarDeclarationPosition gridPos, bool reversed);
Exemple #18
0
 public BTypeDigit(SourceCodePosition pos)
     : base(pos)
 {
     //--
 }
Exemple #19
0
 public abstract CodePiece GenerateCodeReturnFromMethodCall(CodeGenEnvironment env, SourceCodePosition pos, Expression value, bool reversed);
Exemple #20
0
 public BTypeChar(SourceCodePosition pos)
     : base(pos)
 {
     //--
 }
Exemple #21
0
 public BTypeBoolStack(SourceCodePosition pos, int sz)
     : base(pos, sz)
 {
 }
Exemple #22
0
 public BTypeBool(SourceCodePosition pos)
     : base(pos)
 {
     //--
 }
Exemple #23
0
 public ElseActionNode(ActionSequenceNode actions, SourceCodePosition pos) : base(pos)
 {
     Actions = actions;
 }
Exemple #24
0
 public abstract CodePiece GenerateCodeAssignment(CodeGenEnvironment env, SourceCodePosition pos, Expression source, ExpressionValuePointer target, bool reversed);
Exemple #25
0
 public WrongTypeException(SourceCodePosition pos, BType found, BType expec)
     : base(String.Format("Wrong Type found: Found = {0}. Expected = {1}", found, expec), pos)
 {
 }
Exemple #26
0
 public BTypeCharArr(SourceCodePosition pos, int sz)
     : base(pos, sz)
 {
 }
Exemple #27
0
 public ArrayTooSmallException(SourceCodePosition pos)
     : base(String.Format("The size of the array is too small"), pos)
 {
 }
Exemple #28
0
 public abstract CodePiece GenerateCodePopValueFromStack(CodeGenEnvironment env, SourceCodePosition pos, bool reversed);
Exemple #29
0
 public InitGlobalVariableException(SourceCodePosition pos, string ident)
     : base("The global variable " + ident + " has an Initializator, this is not possible for global variables", pos)
 {
 }
Exemple #30
0
 public BTypeUnion(SourceCodePosition pos)
     : base(pos)
 {
     //--
 }