Class ServiceDfnGenerator

java.lang.Object
org.ek9lang.compiler.phase7.AbstractDfnGenerator
org.ek9lang.compiler.phase7.ServiceDfnGenerator
All Implemented Interfaces:
Function<EK9Parser.ServiceDeclarationContext, IRConstruct>

final class ServiceDfnGenerator extends AbstractDfnGenerator implements Function<EK9Parser.ServiceDeclarationContext, IRConstruct>
Creates the appropriate IR Construct for a service declaration.

Services are AggregateSymbols with genus SymbolGenus.SERVICE. Unlike classes/components, service declarations do not use aggregateParts in the grammar. Instead, they contain methodDeclaration and serviceOperationDeclaration directly.

  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.