Class ServiceDfnGenerator
java.lang.Object
org.ek9lang.compiler.phase7.AbstractDfnGenerator
org.ek9lang.compiler.phase7.AggregateDfnGenerator
org.ek9lang.compiler.phase7.ServiceDfnGenerator
- All Implemented Interfaces:
Function<EK9Parser.ServiceDeclarationContext, IRConstruct>
final class ServiceDfnGenerator
extends AggregateDfnGenerator
implements Function<EK9Parser.ServiceDeclarationContext, IRConstruct>
Creates the appropriate IR Construct for a service declaration.
Services are AggregateSymbols with genus SymbolGenus.SERVICE, generated by THE aggregate construct
skeleton (AggregateDfnGenerator) - it used to be a 230-line copy of it that had already drifted (IR tidy
plan DFN-1). The one genuine difference is WHERE a member's body is written: service declarations do not use
aggregateParts in the grammar, they hold methodDeclaration and serviceOperationDeclaration
directly, so the bodies are found by BodiesInServiceDeclaration and there are no property
initialisers for _i_init.
serviceDeclaration
: identifier FOR? Uriproto AS? NL+
INDENT NL* (directive? (methodDeclaration | serviceOperationDeclaration))* DEDENT
;
Service operations have HTTP metadata (verb, URI path) stored in squirrelled data. This metadata is preserved through IR generation for runtime HTTP binding.
-
Field Summary
Fields inherited from class AbstractDfnGenerator
generators, notImplicitSuper, operationDfnGenerator, stackContext, synthesisedCallMetaData -
Constructor Summary
Constructors -
Method Summary
Methods inherited from class AggregateDfnGenerator
beforeInstanceInit, createFieldDeclarations, createInitializationOperations, createOperationsForAggregateParts, matchClonedMethodsBySourceToken, processAggregate, processAggregate, withFieldSetStatusCarrierMethods inherited from class AbstractDfnGenerator
createEmptyInitOperation, createInitOperation, createInstanceInitOperation, getParsedModule, newSyntheticInitOperation, processAsMethodOrOperator, processAsMethodOrOperator, processPropertiesForInstanceInit, processSyntheticConstructor, processSyntheticConstructor, processSyntheticConstructor
-
Constructor Details
-
ServiceDfnGenerator
ServiceDfnGenerator(IRGenerationContext stackContext)
-
-
Method Details
-
apply
- Specified by:
applyin interfaceFunction<EK9Parser.ServiceDeclarationContext, IRConstruct>
-