예제 #1
0
파일: Method.cs 프로젝트: helvm/BefunGen
        public MethodHeader(SourceCodePosition pos, BType t, string ident, List <VarDeclaration> p)
            : base(pos)
        {
            this.ResultType = t;
            this.Identifier = ident;
            this.Parameter  = p;

            if (ASTObject.IsKeyword(ident))
            {
                throw new IllegalIdentifierException(Position, ident);
            }
        }
예제 #2
0
파일: Program.cs 프로젝트: helvm/BefunGen
        public ProgramHeader(SourceCodePosition pos, string ident, int w, int h)
            : base(pos)
        {
            this.Identifier = ident;

            if (ASTObject.IsKeyword(ident))
            {
                throw new IllegalIdentifierException(Position, ident);
            }

            if (w * h == 0)
            {
                DisplayWidth  = 0;
                DisplayHeight = 0;
            }
            else
            {
                DisplayWidth  = w;
                DisplayHeight = h;
            }
        }
예제 #3
0
        public VarDeclaration(SourceCodePosition pos, BType t, string ident, Literal init)
            : base(pos)
        {
            this.Type       = t;
            this.Identifier = ident;
            this.ID         = V_ID_COUNTER;
            this.IsConstant = false;

            if (ASTObject.IsKeyword(ident))
            {
                throw new IllegalIdentifierException(Position, ident);
            }

            if (init == null)
            {
                this.Initial = t.GetDefaultValue();
                HasCompleteUserDefiniedInitialValue = false;
            }
            else
            {
                this.Initial = init;
                HasCompleteUserDefiniedInitialValue = true;
            }
        }