nscn.polaris2.pdefgen
Members list
Type members
Classlikes
Attributes
- Companion
- class
- Supertypes
-
trait Producttrait Mirrorclass Objecttrait Matchableclass Any
- Self type
-
FunctionalPrinter.type
Attributes
- Companion
- object
- Supertypes
-
trait Serializabletrait Producttrait Equalsclass Objecttrait Matchableclass AnyShow all
A validated .pdef: the custom types it declares plus its top-level fields, which become a struct called name.
A validated .pdef: the custom types it declares plus its top-level fields, which become a struct called name.
Both maps are insertion-ordered on purpose. A pdef describes a flat binary layout, so the declaration order of the top-level fields IS the wire order - reordering them silently produces a codec that decodes the wrong bytes into the wrong fields. The type defs are ordered for the weaker reason that generated sources should be stable across runs, so an unchanged .pdef does not invalidate downstream build caches.
Keying by name is only lossless because PdefValidator has already rejected duplicate names: a repeated key would silently replace the earlier field.
Attributes
- Supertypes
-
trait Serializabletrait Producttrait Equalsclass Objecttrait Matchableclass AnyShow all
Attributes
- Supertypes
-
trait Serializabletrait Producttrait Equalstrait PdefTypeclass Objecttrait Matchableclass AnyShow all
Attributes
- Supertypes
-
class Objecttrait Matchableclass Any
- Self type
-
PdefCodePrinter.type
Attributes
- Supertypes
-
trait Serializabletrait Producttrait Equalstrait PdefTypeclass Objecttrait Matchableclass AnyShow all
Attributes
- Supertypes
- Known subtypes
-
class PdefEnumDefclass PdefStructDef
Attributes
- Supertypes
-
trait Serializabletrait Producttrait Equalstrait PdefCustomTypeDeftrait PdefStatementtrait Positionalclass Objecttrait Matchableclass AnyShow all
Attributes
- Supertypes
-
trait Serializabletrait Producttrait Equalstrait PdefTypeclass Objecttrait Matchableclass AnyShow all
Attributes
- Supertypes
-
trait Serializabletrait Producttrait Equalstrait PdefStatementtrait Positionalclass Objecttrait Matchableclass AnyShow all
One .pdef as parsed, before PdefValidator has looked at it.
One .pdef as parsed, before PdefValidator has looked at it.
Value parameters
- name
-
the struct the top-level fields become - the file's base name
- origin
-
where the source came from; problems are reported against it
Attributes
- Supertypes
-
trait Serializabletrait Producttrait Equalsclass Objecttrait Matchableclass AnyShow all
Generation stopped: every problem found in the .pdef files, one per line.
Generation stopped: every problem found in the .pdef files, one per line.
Attributes
- Supertypes
-
trait Producttrait Equalsclass Exceptionclass Throwabletrait Serializableclass Objecttrait Matchableclass AnyShow all
Generates scodec codecs from .pdef binary layout definitions.
Generates scodec codecs from .pdef binary layout definitions.
This is the Mill counterpart of sbt-pdef-gen's PdefGenPlugin. Where the sbt plugin hooks a task into Compile / sourceGenerators, this module owns the whole invocation: every .pdef under pdefSources is parsed, the lot is checked by PdefValidator, and each is rendered into one Scala file named after it, all of them wired into generatedSources.
object app extends ScalaModule, PdefModule {
def scalaVersion = "3.9.0"
// .pdef files live in `app/pdef` by default
}
A file Foo.pdef yields case class Foo(...) plus codec_Foo, alongside a case class/enum and a codec_<name> for every $STRUCT_START/$ENUM_START block it declares.
Attributes
- Companion
- object
- Supertypes
-
trait ScalaModuletrait ScalaModuleApitrait ScalaModuleBasetrait JavaModuletrait JavaModuleApitrait JdkCommandsModuletrait AssemblyModuletrait SemanticDbJavaModuletrait SemanticDbJavaModuleApitrait OfflineSupportModuletrait GenIdeaModuletrait GenIdeaModuleApitrait RunModuletrait RunModuleApitrait DefaultTaskModuletrait JavaModuleBasetrait BspModuletrait BspModuleApitrait WithJvmWorkerModuletrait JavaHomeModuletrait CoursierModuletrait Moduletrait ModuleApitrait Wrapperclass BaseClasstrait Cachertrait Cacherclass Objecttrait Matchableclass AnyShow all
Attributes
- Companion
- trait
- Supertypes
-
class Objecttrait Matchableclass Any
- Self type
-
PdefModule.type
The pdef grammar. Syntax only: whether a parsed file can actually be generated from is PdefValidator's business.
The pdef grammar. Syntax only: whether a parsed file can actually be generated from is PdefValidator's business.
Attributes
- Supertypes
-
trait PackratParserstrait JavaTokenParserstrait RegexParserstrait Parsersclass Objecttrait Matchableclass AnyShow all
- Self type
-
PdefParsers.type
Something wrong with a .pdef, located at the line and column it was found.
Something wrong with a .pdef, located at the line and column it was found.
Attributes
- Supertypes
-
trait Serializabletrait Producttrait Equalsclass Objecttrait Matchableclass AnyShow all
An entry in a .pdef, positioned so problems with it can be reported where it is.
An entry in a .pdef, positioned so problems with it can be reported where it is.
Attributes
- Supertypes
-
trait Positionalclass Objecttrait Matchableclass Any
- Known subtypes
Attributes
- Supertypes
-
trait Serializabletrait Producttrait Equalstrait PdefTypeclass Objecttrait Matchableclass AnyShow all
Attributes
- Supertypes
-
trait Serializabletrait Producttrait Equalstrait PdefCustomTypeDeftrait PdefStatementtrait Positionalclass Objecttrait Matchableclass AnyShow all
Attributes
- Supertypes
-
class Objecttrait Matchableclass Any
- Known subtypes
-
class PdefArrayobject PdefBoolclass PdefCustomTypeclass PdefEnumMapobject PdefFloatobject PdefIntclass PdefStringShow all
Checks parsed .pdef files before anything is generated from them.
Checks parsed .pdef files before anything is generated from them.
Every problem caught here would otherwise turn up later and worse: as a scalac error pointing into generated code, or - for a field declared twice - as no error at all, just a codec one field short.
The files are checked as one unit because they are generated into one package: a type declared in one file is in scope in all of them, and a name declared twice collides whichever files the two declarations are in.
Attributes
- Supertypes
-
class Objecttrait Matchableclass Any
- Self type
-
PdefValidator.type