Example #1
0
 public DHJassExitLoopWhenOperation(List <string> lines, ref int line, List <string> args)
 {
     Condition = new DHJassGetValueOnDemandCommand(args[0]);
     if (DHJassCompiler.Loops.Count != 0)
     {
         DHJassLoopOperation Loop = DHJassCompiler.Loops.Peek();
         LoopEndPoint = Loop.EndPoint;
     }
 }
Example #2
0
        public DHJassIfElseOperation(List <string> lines, ref int line, List <string> args, DHJassEmptyOperation endPoint)
        {
            DHJassOperation StatementEndPoint;

            Condition = new DHJassGetValueOnDemandCommand(args[0]);
            line++;
            if (DHJassFunction.TryCreateBody(lines, ref line, this, out Then, out StatementEndPoint))
            {
                this.EndPoint = endPoint;

                StatementEndPoint.SetNext(EndPoint);

                string currentLine = lines[line].Trim();

                switch (currentLine)
                {
                case "else":
                    line++;
                    if (DHJassFunction.TryCreateBody(lines, ref line, this, out Else, out StatementEndPoint))
                    {
                        StatementEndPoint.SetNext(EndPoint);
                    }
                    break;

                case "endif":
                    Else = EndPoint;
                    break;

                default:
                    if (this.IsSyntaxMatch(currentLine, out args))
                    {
                        Else = new DHJassIfElseOperation(lines, ref line, args, endPoint);
                        //Else.GetLast().SetNext(EndPoint);
                    }
                    break;
                }
            }
        }
Example #3
0
 public DHJassReturnOperation(List <string> lines, ref int line, List <string> args)
 {
     //returnValueCode = match.Groups["value"].Value;
     returnCommand = new DHJassGetValueOnDemandCommand(args[0]);
 }