public DslAdapter(string dslFile, string definitionFile, GrammarLanguages grammarLanguage) { RuleBaseBuilder rbb = new RuleBaseBuilder(new Definitions(definitionFile)); string ruleml = null; if (grammarLanguage == GrammarLanguages.EN) { InferenceRules_ENParser ipr = new InferenceRules_ENParser( new CommonTokenStream( new InferenceRules_ENLexer( new ANTLRFileStream(dslFile)))); ipr.rbb = rbb; ipr.rulebase(); ruleml = ipr.rbb.RuleML; } else if (grammarLanguage == GrammarLanguages.FR) { InferenceRules_FRParser ipr = new InferenceRules_FRParser( new CommonTokenStream( new InferenceRules_FRLexer( new ANTLRFileStream(dslFile)))); ipr.rbb = rbb; ipr.rulebase(); ruleml = ipr.rbb.RuleML; } adapter = new RuleML09NafDatalogAdapter(new MemoryStream(new UTF8Encoding().GetBytes(ruleml)), FileAccess.Read); }
public DslAdapter(string dslFile, string definitionFile, GrammarLanguages grammarLanguage) { RuleBaseBuilder rbb = new RuleBaseBuilder(new Definitions(definitionFile)); string ruleml = null; if (grammarLanguage == GrammarLanguages.EN) { InferenceRules_ENParser ipr = new InferenceRules_ENParser( new CommonTokenStream( new InferenceRules_ENLexer( new ANTLRFileStream(dslFile)))); ipr.rbb = rbb; ipr.rulebase(); ruleml = ipr.rbb.RuleML; } else if (grammarLanguage == GrammarLanguages.FR) { InferenceRules_FRParser ipr = new InferenceRules_FRParser( new CommonTokenStream( new InferenceRules_FRLexer( new ANTLRFileStream(dslFile)))); ipr.rbb = rbb; ipr.rulebase(); ruleml = ipr.rbb.RuleML; } adapter = new RuleML09NafDatalogAdapter(new MemoryStream(new UTF8Encoding().GetBytes(ruleml)), FileAccess.Read); }
public DslAdapter(string dslFile, GrammarLanguages grammarLanguage) : this(dslFile, dslFile + ".defs", grammarLanguage) { }
public DslAdapter(string dslFile, GrammarLanguages grammarLanguage) : this(dslFile, dslFile + ".defs", grammarLanguage) { }