Search in sources :

Example 96 with Grammar

use of org.whole.lang.grammars.model.Grammar in project whole by wholeplatform.

the class DataTypesGrammarsDataTypeParser method deploy.

public static void deploy(String grammarURI) {
    Grammar grammar = GrammarsRegistry.instance().getGrammar(grammarURI);
    ILanguageKit lk = ReflectionFactory.getLanguageKit(GrammarsUtils.getLanguageURI(grammar), false, null);
    EntityDescriptor<?> ed = lk.getEntityDescriptorEnum().valueOf("DateLiteral");
    Map<EntityDescriptor<?>, IDataTypeParser> strategies = new HashMap<EntityDescriptor<?>, IDataTypeParser>();
    strategies.put(ed, new DataTypesGrammarsDataTypeParser());
    install(lk, strategies);
}
Also used : EntityDescriptor(org.whole.lang.reflect.EntityDescriptor) HashMap(java.util.HashMap) Grammar(org.whole.lang.grammars.model.Grammar) IDataTypeParser(org.whole.lang.parsers.IDataTypeParser) ILanguageKit(org.whole.lang.reflect.ILanguageKit)

Aggregations

Grammar (org.whole.lang.grammars.model.Grammar)96 Test (org.junit.Test)82 TestXmlGrammar (org.whole.lang.grammars.util.TestXmlGrammar)80 IEntity (org.whole.lang.model.IEntity)50 ITemplateManager (org.whole.lang.templates.ITemplateManager)46 Production (org.whole.lang.grammars.model.Production)43 PathExpression (org.whole.lang.queries.model.PathExpression)40 IBindingManager (org.whole.lang.bindings.IBindingManager)28 QueriesGrammar (org.whole.lang.grammars.codebase.QueriesGrammar)25 NonTerminal (org.whole.lang.grammars.model.NonTerminal)14 Productions (org.whole.lang.grammars.model.Productions)14 HashSet (java.util.HashSet)8 PrettyPrinterOperation.toPrettyPrintString (org.whole.lang.operations.PrettyPrinterOperation.toPrettyPrintString)7 Rule (org.whole.lang.grammars.model.Rule)6 XmlGrammar (org.whole.lang.grammars.codebase.XmlGrammar)3 As (org.whole.lang.grammars.model.As)3 Feature (org.whole.lang.models.model.Feature)3 ILanguageKit (org.whole.lang.reflect.ILanguageKit)3 ArrayList (java.util.ArrayList)2 IGrammarProvider (org.whole.lang.grammars.codebase.IGrammarProvider)2