...
This commit is contained in:
27
lib/core/codegenerator/factory.v
Normal file
27
lib/core/codegenerator/factory.v
Normal file
@@ -0,0 +1,27 @@
|
||||
module codegenerator
|
||||
|
||||
@[params]
|
||||
pub struct GeneratorOptions {
|
||||
pub:
|
||||
parser_path string @[required]
|
||||
output_dir string @[required]
|
||||
recursive bool = true
|
||||
format bool = true
|
||||
}
|
||||
|
||||
pub fn new(args GeneratorOptions) !CodeGenerator {
|
||||
import incubaid.herolib.core.codeparser
|
||||
|
||||
mut parser := codeparser.new(
|
||||
path: args.parser_path
|
||||
recursive: args.recursive
|
||||
)!
|
||||
|
||||
parser.parse()!
|
||||
|
||||
return CodeGenerator{
|
||||
parser: parser
|
||||
output_dir: args.output_dir
|
||||
format: args.format
|
||||
}
|
||||
}
|
||||
Reference in New Issue
Block a user