Пример #1
0
 public static void SetUp(Module module, Grammar grammar)
 {
     if (pattern == null)
     {
         pattern = new AbstractPattern(null, "Expression");
         pattern.SetType(typeof(Expression));
     }
     
     module.SetName("Expression", typeof(Expression));
     grammar.PatternDefined(pattern);
 }
Пример #2
0
 public static void SetUp(Module module, Grammar grammar)
 {
     if (pattern == null)
     {
         pattern = new AbstractPattern(null, "Statement");
         pattern.SetType(typeof(Statement));
     }
     
     module.SetName("Statement", typeof(Statement));
     grammar.PatternDefined(pattern);
 }
Пример #3
0
 public new static void SetUp(Module module, Grammar grammar)
 {
     if (pattern == null)
     {
         string expression = "s('module' l(name 0) l(body 1))";
         Pattern[] patterns = {Name.pattern, Statement.pattern};
     
         ParseGraphNode parseGraph = BootstrapParser.Parse(expression, patterns);
 
         pattern = new ConcretePattern(null, "ModuleStatement", parseGraph);
         pattern.SetType(typeof(ModuleStatement));
     
         Statement.pattern.AddAltPattern(pattern);
     }
     
     module.SetName("ModuleStatement", typeof(ModuleStatement));
     grammar.PatternDefined(pattern);
 }
 public new static void SetUp(Module module, Grammar grammar)
 {
     if (pattern == null)
     {
         string expression = "s('precedence' l(a a(0 1)) l(relation o((buildTextNodes true) a('<' '=' '>'))) l(b a(0 1)) ';')";
         Pattern[] patterns = {MemberExpression.pattern, NameExpression.pattern};
     
         ParseGraphNode parseGraph = BootstrapParser.Parse(expression, patterns);
 
         pattern = new ConcretePattern(null, "SetPrecedenceStatement", parseGraph);
         pattern.SetType(typeof(SetPrecedenceStatement));
     
         Statement.pattern.AddAltPattern(pattern);
     }
     
     module.SetName("SetPrecedenceStatement", typeof(SetPrecedenceStatement));
     grammar.PatternDefined(pattern);
 }
Пример #5
0
 public new static void SetUp(Module module, Grammar grammar)
 {
     if (pattern == null)
     {
         string expression = "s('using' l(expression 0) ';')";
         Pattern[] parameters = {Expression.pattern};
     
         ParseGraphNode parseGraph = BootstrapParser.Parse(expression, parameters);
     
         pattern = new ConcretePattern(null, "UsingStatement", parseGraph);
         pattern.SetType(typeof(UsingStatement));
     
         Statement.pattern.AddAltPattern(pattern);
     }
     
     module.SetName("UsingStatement", typeof(UsingStatement));
     grammar.PatternDefined(pattern);
 }
Пример #6
0
 public new static void SetUp(Module module, Grammar grammar)
 {
     if (pattern == null)
     {
         string expression = "s('class' l(name 0) ?(s(':' l(baseType a(2 3)))) a(';' s('{' l(members *(1)) '}')))";
         Pattern[] patterns = {Name.pattern, Member.pattern, MemberExpression.pattern, NameExpression.pattern};
     
         ParseGraphNode parseGraph = BootstrapParser.Parse(expression, patterns);
 
         pattern = new ConcretePattern(null, "ClassStatement", parseGraph);
         pattern.SetType(typeof(ClassStatement));
     
         Statement.pattern.AddAltPattern(pattern);
     }
     
     module.SetName("ClassStatement", typeof(ClassStatement));
     grammar.PatternDefined(pattern);
 }
Пример #7
0
 public new static void SetUp(Module module, Grammar grammar)
 {
     if (pattern == null)
     {
         string parameters = "'(' l(parameters ?(s(1 *(s(',' 0))))) ')'";
         string expression = "s('function' l(name 0) " + parameters + " l(body 2))";
         Pattern[] patterns = {Name.pattern, Name.pattern, Statement.pattern};
     
         ParseGraphNode parseGraph = BootstrapParser.Parse(expression, patterns);
 
         pattern = new ConcretePattern(null, "FunctionStatement", parseGraph);
         pattern.SetType(typeof(FunctionStatement));
     
         Statement.pattern.AddAltPattern(pattern);
     }
     
     module.SetName("FunctionStatement", typeof(FunctionStatement));
     grammar.PatternDefined(pattern);
 }