MacroProcessor class

The main engine responsible for macro processing and expansion.

This class handles:

  • Macro definition and management
  • Macro expansion and substitution
  • Recursion detection and prevention
  • Error handling and validation
Available extensions

Constructors

MacroProcessor.new()

Properties

hashCode int
The hash code for this object.
no setterinherited
runtimeType Type
A representation of the runtime type of the object.
no setterinherited

Methods

define({required String name, List<String> parameters = const [], required String replacement, required Location location}) → void
Defines a new macro in the system.
defineFromProperties(String propertiesPath, Location location) Future<void>

Available on MacroProcessor, provided by the ResourceProcessorExtension extension

Define macros from a properties file
defineFromResource(String name, String resourcePath, Location location) Future<void>

Available on MacroProcessor, provided by the ResourceLoaderExtension extension

Defines a macro from a resource file.
handleDataAnnotation(String source, String className, Location location) → void

Available on MacroProcessor, provided by the DataAnnotationHandler extension

Processes a @Data annotation on a class.
includeResource(String resourcePath, Location location) Future<String>

Available on MacroProcessor, provided by the ResourceProcessorExtension extension

Include the contents of a resource file
isDefined(String name) bool
Checks if a macro with the given name is defined.
noSuchMethod(Invocation invocation) → dynamic
Invoked when a nonexistent method or property is accessed.
inherited
process(String source, {required String filePath}) String
Processes source code and expands all macro usages.
toString() String
A string representation of this object.
inherited
undefine(String name) → void
Removes a macro definition from the system.

Operators

operator ==(Object other) bool
The equality operator.
inherited