Search in sources :

Example 1 with JSONNullLiteral

use of org.eclipse.n4js.json.JSON.JSONNullLiteral in project n4js by eclipse.

the class JSONSemanticSequencer 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 == JSONPackage.eINSTANCE)
        switch(semanticObject.eClass().getClassifierID()) {
            case JSONPackage.JSON_ARRAY:
                sequence_JSONArray(context, (JSONArray) semanticObject);
                return;
            case JSONPackage.JSON_BOOLEAN_LITERAL:
                sequence_JSONBooleanLiteral(context, (JSONBooleanLiteral) semanticObject);
                return;
            case JSONPackage.JSON_DOCUMENT:
                sequence_JSONDocument(context, (JSONDocument) semanticObject);
                return;
            case JSONPackage.JSON_NULL_LITERAL:
                sequence_JSONNullLiteral(context, (JSONNullLiteral) semanticObject);
                return;
            case JSONPackage.JSON_NUMERIC_LITERAL:
                sequence_JSONNumericLiteral(context, (JSONNumericLiteral) semanticObject);
                return;
            case JSONPackage.JSON_OBJECT:
                sequence_JSONObject(context, (JSONObject) semanticObject);
                return;
            case JSONPackage.JSON_STRING_LITERAL:
                sequence_JSONStringLiteral(context, (JSONStringLiteral) semanticObject);
                return;
            case JSONPackage.NAME_VALUE_PAIR:
                sequence_NameValuePair(context, (NameValuePair) semanticObject);
                return;
        }
    if (errorAcceptor != null)
        errorAcceptor.accept(diagnosticProvider.createInvalidContextOrTypeDiagnostic(semanticObject, context));
}
Also used : ParserRule(org.eclipse.xtext.ParserRule) NameValuePair(org.eclipse.n4js.json.JSON.NameValuePair) Action(org.eclipse.xtext.Action) JSONArray(org.eclipse.n4js.json.JSON.JSONArray) JSONNumericLiteral(org.eclipse.n4js.json.JSON.JSONNumericLiteral) JSONStringLiteral(org.eclipse.n4js.json.JSON.JSONStringLiteral) EPackage(org.eclipse.emf.ecore.EPackage) JSONBooleanLiteral(org.eclipse.n4js.json.JSON.JSONBooleanLiteral) JSONObject(org.eclipse.n4js.json.JSON.JSONObject) Parameter(org.eclipse.xtext.Parameter) JSONDocument(org.eclipse.n4js.json.JSON.JSONDocument) JSONNullLiteral(org.eclipse.n4js.json.JSON.JSONNullLiteral)

Aggregations

EPackage (org.eclipse.emf.ecore.EPackage)1 JSONArray (org.eclipse.n4js.json.JSON.JSONArray)1 JSONBooleanLiteral (org.eclipse.n4js.json.JSON.JSONBooleanLiteral)1 JSONDocument (org.eclipse.n4js.json.JSON.JSONDocument)1 JSONNullLiteral (org.eclipse.n4js.json.JSON.JSONNullLiteral)1 JSONNumericLiteral (org.eclipse.n4js.json.JSON.JSONNumericLiteral)1 JSONObject (org.eclipse.n4js.json.JSON.JSONObject)1 JSONStringLiteral (org.eclipse.n4js.json.JSON.JSONStringLiteral)1 NameValuePair (org.eclipse.n4js.json.JSON.NameValuePair)1 Action (org.eclipse.xtext.Action)1 Parameter (org.eclipse.xtext.Parameter)1 ParserRule (org.eclipse.xtext.ParserRule)1