Search in sources :

Example 1 with Literal

use of org.eclipse.xtext.ui.codetemplates.templates.Literal in project xtext-eclipse by eclipse.

the class SingleCodetemplateSemanticSequencer method sequence.

@Override
public void sequence(ISerializationContext context, EObject semanticObject) {
    EPackage epackage = semanticObject.eClass().getEPackage();
    ParserRule rule = context.getParserRule();
    Action action = context.getAssignedAction();
    Set<Parameter> parameters = context.getEnabledBooleanParameters();
    if (epackage == TemplatesPackage.eINSTANCE)
        switch(semanticObject.eClass().getClassifierID()) {
            case TemplatesPackage.CODETEMPLATE:
                sequence_Codetemplate(context, (Codetemplate) semanticObject);
                return;
            case TemplatesPackage.CODETEMPLATES:
                sequence_Codetemplates(context, (Codetemplates) semanticObject);
                return;
            case TemplatesPackage.DOLLAR:
                sequence_Dollar(context, (Dollar) semanticObject);
                return;
            case TemplatesPackage.LITERAL:
                sequence_Literal(context, (Literal) semanticObject);
                return;
            case TemplatesPackage.TEMPLATE_BODY:
                sequence_TemplateBody(context, (TemplateBody) semanticObject);
                return;
            case TemplatesPackage.VARIABLE:
                sequence_Variable(context, (Variable) semanticObject);
                return;
        }
    if (errorAcceptor != null)
        errorAcceptor.accept(diagnosticProvider.createInvalidContextOrTypeDiagnostic(semanticObject, context));
}
Also used : ParserRule(org.eclipse.xtext.ParserRule) Action(org.eclipse.xtext.Action) Codetemplates(org.eclipse.xtext.ui.codetemplates.templates.Codetemplates) Variable(org.eclipse.xtext.ui.codetemplates.templates.Variable) Dollar(org.eclipse.xtext.ui.codetemplates.templates.Dollar) Codetemplate(org.eclipse.xtext.ui.codetemplates.templates.Codetemplate) Literal(org.eclipse.xtext.ui.codetemplates.templates.Literal) Parameter(org.eclipse.xtext.Parameter) TemplateBody(org.eclipse.xtext.ui.codetemplates.templates.TemplateBody) EPackage(org.eclipse.emf.ecore.EPackage)

Example 2 with Literal

use of org.eclipse.xtext.ui.codetemplates.templates.Literal in project xtext-eclipse by eclipse.

the class CodetemplatesSemanticSequencer method sequence.

@Override
public void sequence(ISerializationContext context, EObject semanticObject) {
    EPackage epackage = semanticObject.eClass().getEPackage();
    ParserRule rule = context.getParserRule();
    Action action = context.getAssignedAction();
    Set<Parameter> parameters = context.getEnabledBooleanParameters();
    if (epackage == TemplatesPackage.eINSTANCE)
        switch(semanticObject.eClass().getClassifierID()) {
            case TemplatesPackage.CODETEMPLATE:
                sequence_Codetemplate(context, (Codetemplate) semanticObject);
                return;
            case TemplatesPackage.CODETEMPLATES:
                sequence_Codetemplates(context, (Codetemplates) semanticObject);
                return;
            case TemplatesPackage.DOLLAR:
                sequence_Dollar(context, (Dollar) semanticObject);
                return;
            case TemplatesPackage.LITERAL:
                sequence_Literal(context, (Literal) semanticObject);
                return;
            case TemplatesPackage.TEMPLATE_BODY:
                sequence_TemplateBody(context, (TemplateBody) semanticObject);
                return;
            case TemplatesPackage.VARIABLE:
                sequence_Variable(context, (Variable) semanticObject);
                return;
        }
    if (errorAcceptor != null)
        errorAcceptor.accept(diagnosticProvider.createInvalidContextOrTypeDiagnostic(semanticObject, context));
}
Also used : ParserRule(org.eclipse.xtext.ParserRule) Action(org.eclipse.xtext.Action) Codetemplates(org.eclipse.xtext.ui.codetemplates.templates.Codetemplates) Variable(org.eclipse.xtext.ui.codetemplates.templates.Variable) Dollar(org.eclipse.xtext.ui.codetemplates.templates.Dollar) Codetemplate(org.eclipse.xtext.ui.codetemplates.templates.Codetemplate) Literal(org.eclipse.xtext.ui.codetemplates.templates.Literal) Parameter(org.eclipse.xtext.Parameter) TemplateBody(org.eclipse.xtext.ui.codetemplates.templates.TemplateBody) EPackage(org.eclipse.emf.ecore.EPackage)

Aggregations

EPackage (org.eclipse.emf.ecore.EPackage)2 Action (org.eclipse.xtext.Action)2 Parameter (org.eclipse.xtext.Parameter)2 ParserRule (org.eclipse.xtext.ParserRule)2 Codetemplate (org.eclipse.xtext.ui.codetemplates.templates.Codetemplate)2 Codetemplates (org.eclipse.xtext.ui.codetemplates.templates.Codetemplates)2 Dollar (org.eclipse.xtext.ui.codetemplates.templates.Dollar)2 Literal (org.eclipse.xtext.ui.codetemplates.templates.Literal)2 TemplateBody (org.eclipse.xtext.ui.codetemplates.templates.TemplateBody)2 Variable (org.eclipse.xtext.ui.codetemplates.templates.Variable)2