示例#1
0
 public void Insert(Statement instruction)
 {
     if (instruction != null)
         Statements.Insert(0, instruction);
 }
示例#2
0
 public ContainerStatement(Statement instruction, Location location)
     : base(location)
 {
     if (instruction != null)
         Statements.Add(instruction);
 }
示例#3
0
 public void Add(Statement instruction)
 {
     if (instruction != null)
         Statements.Add(instruction);
 }
示例#4
0
        private ForRofContainerStatement CreateForrof(List<string> comments, Expression expression, Statement statement, List<LabelName> statementlabels, NonterminalToken token)
        {
            ForRofContainerStatement forrof;
            forrof = new ForRofContainerStatement(token.Location);
            forrof.Comments = comments;
            forrof.Labels = statementlabels;
            forrof.Add(statement);

            LabelName l = new LabelName(expression.Location, "#forof" + rofforCounter);
            if (statementlabels.Count > 0)
            {
                l = statementlabels[statementlabels.Count - 1];
            }
            else
            {
                statementlabels.Add(l);
            }

            //for label could be reused
            //CheckName(l, token.Tokens[1].Location);
            variables[l.Name] = expression;

            //for label could be reused
            //CheckName(l, token.Tokens[1].Location);
            forrof.LimitName = l.Name + "#" + rofforCounter + "#limit";
            variables[forrof.LimitName] = expression;

            rofforCounter++;
            return forrof;
        }