1 using System;
2 using System.Collections;
3
4
5
6
7
8 namespace soulcm.scmlg
9 {
10 public class RegularExpressionParser : Parser
11 {
12 public override Nfa Parse(const ustring& expression, LexerContext* lexerContext, int line)
13 {
14 try
15 {
16 RegExLexer lexer(expression, lexerContext->FileName(), 0);
17 return RegExParser.Parse(lexer, lexerContext);
18 }
19 catch (const Exception& ex)
20 {
21 throw Exception("error parsing regular expression at " + lexerContext->FileName() + ":" + ToString(line) + ": " + ex.Message());
22 }
23 return Nfa();
24 }
25 }
26 }