Class 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.