Exemplo n.º 1
0
 public void Insert(Statement instruction)
 {
     if (instruction != null)
         Statements.Insert(0, instruction);
 }
Exemplo n.º 2
0
 public ContainerStatement(Statement instruction, Location location)
     : base(location)
 {
     if (instruction != null)
         Statements.Add(instruction);
 }
Exemplo n.º 3
0
 public void Add(Statement instruction)
 {
     if (instruction != null)
         Statements.Add(instruction);
 }
Exemplo n.º 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;
        }