Exemplo n.º 1
0
        public override void LoadCommand(Whee.WordBuilder.ProjectV2.IProjectSerializer serializer)
        {
            m_lineNumber = serializer.LineNumber;
            ProjectV2.Token name = serializer.ReadTextToken(this);
            if (name != null)
            {
                Name      = name.Text;
                name.Type = Whee.WordBuilder.ProjectV2.TokenType.Name;

                ProjectV2.Token rule = serializer.ReadTextToken(this);
                if (rule != null)
                {
                    Rule      = rule.Text;
                    rule.Type = Whee.WordBuilder.ProjectV2.TokenType.Name;

                    if (serializer.ReadTextToken(this) != null)
                    {
                        serializer.Warn("The branch command requires 2 arguments.", this);
                    }
                }
                else
                {
                    serializer.Warn("The branch command requires 2 arguments.", this);
                }
            }
            else
            {
                serializer.Warn("The branch command requires 2 arguments.", this);
            }
        }
Exemplo n.º 2
0
        public override void LoadCommand(Whee.WordBuilder.ProjectV2.IProjectSerializer serializer)
        {
            m_lineNumber = serializer.LineNumber;

            bool   found  = false;
            double amount = 0.0;

            ProjectV2.Token amountToken = serializer.ReadNumericToken(this, ref amount, out found);

            if (amountToken != null)
            {
                _Amount = (int)amount;
                if (serializer.ReadTextToken(this) != null)
                {
                    serializer.Warn("The leave command requires zero or one argument.", this);
                }
            }
            else if (found)
            {
                serializer.Warn("The leave command requires the first argument to be a positive integer.", this);
            }
            else
            {
                _Amount = 1;
            }
        }
Exemplo n.º 3
0
        public override void LoadCommand(Whee.WordBuilder.ProjectV2.IProjectSerializer serializer)
        {
            m_lineNumber = serializer.LineNumber;

            double position = 0;
            bool   found    = false;

            ProjectV2.Token posToken = serializer.ReadNumericToken(this, ref position, out found);
            if (posToken != null)
            {
                _Position = (int)position;

                if (serializer.ReadTextToken(this) != null)
                {
                    serializer.Warn("The capitalize command requires zero or one argument.", this);
                }
            }
            else if (found)
            {
                serializer.Warn("The capitalize command requires the first argument to be an integer.", this);
            }
            else
            {
                _Position = -1;
            }
        }
Exemplo n.º 4
0
        public override void LoadCommand(Whee.WordBuilder.ProjectV2.IProjectSerializer serializer)
        {
            m_lineNumber = serializer.LineNumber;
            ProjectV2.Token literal = serializer.ReadTextToken(this);
            if (literal != null)
            {
                Literal = literal.Text;

                if (serializer.ReadTextToken(this) != null)
                {
                    serializer.Warn("The prelit command requires 1 argument.", this);
                }
            }
            else
            {
                serializer.Warn("The prelit command requires 1 argument.", this);
            }
        }
Exemplo n.º 5
0
        public override void LoadCommand(Whee.WordBuilder.ProjectV2.IProjectSerializer serializer)
        {
            m_lineNumber = serializer.LineNumber;

            ProjectV2.Token tokenSet = serializer.ReadTextToken(this);

            if (tokenSet != null)
            {
                _TokenSet = tokenSet.Text;

                if (serializer.ReadTextToken(this) != null)
                {
                    serializer.Warn("The prefix command requires one argument.", this);
                }
            }
            else
            {
                serializer.Warn("The prefix command requires one argument.", this);
            }
        }
Exemplo n.º 6
0
        public override void LoadCommand(Whee.WordBuilder.ProjectV2.IProjectSerializer serializer)
        {
            m_lineNumber = serializer.LineNumber;

            bool   found  = false;
            double amount = 0.0;

            ProjectV2.Token amountToken = serializer.ReadNumericToken(this, ref amount, out found);

            if (amountToken != null)
            {
                _StartIndex = (int)amount;

                amountToken = serializer.ReadNumericToken(this, ref amount, out found);

                if (amountToken != null)
                {
                    _EndIndex = (int)amount;
                    if (serializer.ReadTextToken(this) != null)
                    {
                        serializer.Warn("The substring command requires one or two arguments.", this);
                    }
                }
                else if (found)
                {
                    serializer.Warn("The substring command requires its arguments to be positive integers.", this);
                }
            }
            else if (found)
            {
                serializer.Warn("The substring command requires its arguments to be positive integers.", this);
            }
            else
            {
                serializer.Warn("The substring command requires one or two arguments.", this);
            }
        }