static Rule() { predefinedRulePropertiesDict.Add(new Attribute("parser")); predefinedRulePropertiesDict.Add(new Attribute("text")); predefinedRulePropertiesDict.Add(new Attribute("start")); predefinedRulePropertiesDict.Add(new Attribute("stop")); predefinedRulePropertiesDict.Add(new Attribute("ctx")); }
static AttributeDict() { predefinedTokenDict.Add(new Attribute("text")); predefinedTokenDict.Add(new Attribute("type")); predefinedTokenDict.Add(new Attribute("line")); predefinedTokenDict.Add(new Attribute("index")); predefinedTokenDict.Add(new Attribute("pos")); predefinedTokenDict.Add(new Attribute("channel")); predefinedTokenDict.Add(new Attribute("int")); }
public static AttributeDict Parse([Nullable] ActionAST action, string s, char separator, Grammar g) { AttributeDict dict = new AttributeDict(); IList<System.Tuple<string, int>> decls = SplitDecls(s, separator); foreach (System.Tuple<string, int> decl in decls) { if (decl.Item1.Trim().Length > 0) { Attribute a = ParseAttributeDef(action, decl, g); dict.Add(a); } } return dict; }