public AsmParser(AsmLexer lexer, ProgramLine prgLine)
 {
     this.lexer = lexer;
     this.lineNumber = prgLine.LineNumber;
     this.prgLine = prgLine;
 }
        public static ProgramLine ParseProgramLine(string programLineText, int lineNumber, bool ignoreCase)
        {
            // Create a new program line from text
            ProgramLine programLine = new ProgramLine() { LineNumber = lineNumber, Text = programLineText };

            // Ignore custom assembler directives
            if (programLineText.Length > 0)
            {
                string trimText = programLineText.Trim();
                if (trimText.Length > 0 && (trimText[0] == '#' || trimText[0] == '.'))
                {
                    programLine.Comment = programLineText;
                    return programLine;
                }
            }

            // Parse the program line
            AsmLexer lexer = new AsmLexer(programLine.Text, programLine.LineNumber, ignoreCase);
            AsmParser parser = new AsmParser(lexer, programLine);
            try
            {
                parser.ParseProgramLine();
            }
            catch (Exception e)
            {
                programLine.Error = new ProgramLineError() { ErrorMessage = e.Message, StartColumnIndex = 0, EndColumnIndex = programLine.Text.Length - 1 };
            }

            return programLine;
        }