Example #1
0
        public Tokenizer(string[] lines)
        {
            OpenTokens = new TokenType[]
            {
                TokenType.BRACKETOPEN,
                TokenType.ELIPSISOPEN
            };

            CloseTokens = new TokenType[]
            {
                TokenType.BRACKETOPEN,
                TokenType.ELIPSISOPEN
            };

            needsClosure = new Stack<Token>();
            ifTokens = new Stack<Token>();
            tokens = new List<Token>();

            tokenize(lines);
        }
 private void start_Parsr()
 {
     if (MainForm.error)
     {
         MessageBox.Show("Your data have error !", "RunTime Error");
         Dispose();
     }
     error = false;
     counter_lah = 0;
     aryBody = MainForm.Body.ToArray();
     try
     {
         Lookahead = aryBody[counter_lah];
     }
     catch (Exception ex) { MessageBox.Show(ex.Message, ex.Source, MessageBoxButtons.OK, MessageBoxIcon.Asterisk); }
     counter_lah++;
     ProcessRequest();
 }
Example #3
0
 public TokenTypePattern(params TokenType[] tokenTypes)
 {
     m_TokenTypes = tokenTypes;
 }
Example #4
0
 private void btnParser_Click(object sender, EventArgs e)
 {
     error = false;
     Postfix = "";
     counter_lah = 0;
     aryBody = Body.ToArray();
     try
     {
         Lookahead = aryBody[counter_lah];
     }
     catch (Exception ex)
     { MessageBox.Show(ex.Message, ex.Source, MessageBoxButtons.OK, MessageBoxIcon.Asterisk); }
     counter_lah++;
     E();
     if (!error)
         rtxtBody.AppendText("\n>> " + Postfix + "\n\n");
 }
Example #5
0
 public ParserException_ExpectedTokens(string input_text, int error_pos, params TokenType[] token_types)
     : base(input_text, error_pos, string.Format("Expected one of the following tokens: {0}", TokenTypesToString(token_types)))
 {
     m_ExpectedTokenTypes = token_types;
 }