Run a given generator

@param {String} generatorName - The name of the generator to run
@param {String} name - The name of the generated item
@param {Object} flags - The flags passed to the generator
971233
function generate (generatorName, name, flags) {
  let generator

  switch (generatorName) {
    case 'app':
      generator = new generators.App(name)
      break
    case 'controller':
      generator = new generators.Controller(name, flags)
      break
    case 'model':
      generator = new generators.Model(name, flags)
      break
    case 'view':
      console.log(`generating view ${name} ...`)
      console.log('NotImplemented. View generation not yet available')
      break
    case 'migration':
      generator = new generators.Migration(name, flags)
      break
    case 'scaffold':
      console.log(`generating scaffold ${name} ...`)
      console.log('NotImplemented. Scaffold generation not yet available')
      break
    case 'user':
      console.log(`generating user ${name} ...`)
      console.log('NotImplemented. User generation not yet available')
      break
    default:
      if (!name) {
        return generate('app', generatorName)
      }
  }

  if (!generator) {
    return cli.showHelp(0)
  }

  return generator.run()
}
734116
public static void writeGenerators( IGeneratorSet generators, OutputStream outputStream)
    {
    try( GeneratorSetJsonWriter writer = new GeneratorSetJsonWriter( outputStream))
      {
      writer.write( generators);
      }
    catch( Exception e)
      {
      throw new RuntimeException( "Can't write generator definitions", e);
      }
    }
115468
def _setFlag(self, name, val, defVal):
        """"""
        if not hasattr(self, "flags"):
            self.flags = {}
        if val != defVal:
            self.flags[name] = val
1236363
function run(grammar, module, filename) {

  // this is used to bind OMeta to runtime. It can be used also (lateron) to dynamically
  // inject other environment-variables.  
  //   {a:1,b:2,c:3,d:4} -> function(a,b,c,d) {...}.call(1,2,3,4)
  // this is better than `with`, since it offers full control
  var source = [
    "module.grammar = (function(OMeta) {",
      grammar,
    "});"
  ].join('');

  module._compile(source, filename);
  module.grammar.call(module, ometa);
  return module.exports;
}
1167940
protected function visitTranslatedList(Generator $generator, array $translatedElements, $listName)
    {
        $generator->startHashElement($listName);
        $generator->startList('value');
        foreach ($translatedElements as $languageCode => $element) {
            $generator->startValueElement('value', $element, array('languageCode' => $languageCode));
            $generator->endValueElement('value');
        }
        $generator->endList('value');
        $generator->endHashElement($listName);
    }
1036063
public static void start(String name) {
    if (!active) return;

    TimerNode root = new TimerNode(name, System.currentTimeMillis());
    TimerStack stack = (TimerStack) curStack.get();
    if (null == stack) curStack.set(new TimerStack(root));
    else stack.push(root);
  }
1347419
function run(keywordsToRun, keywordsDefined, passedArguments) {
        var vars = helpers.createLocalEnv(passedArguments);
        keywordsToRun = helpers.createKeywords(keywordsToRun);

        return {
            then: function(callback) {
                runKeywords(keywordsToRun, keywordsDefined, vars, callback);
            }
        };
    }
1348246
def generators():
    
    from populous import generators

    base = generators.Generator

    for name in dir(generators):
        generator = getattr(generators, name)

        if isinstance(generator, type) and issubclass(generator, base):
            name = generator.__name__
            doc = (generator.__doc__ or '').strip()

            if doc:
                click.echo("{} - {}".format(name, doc))
            else:
                click.echo(name)
894917
def _pretty_access_flags_gen(self):
        

        if self.is_public():
            yield "public"
        if self.is_final():
            yield "final"
        if self.is_abstract():
            yield "abstract"
        if self.is_interface():
            if self.is_annotation():
                yield "@interface"
            else:
                yield "interface"
        if self.is_enum():
            yield "enum"
170411
def command_gen(self, *names):
        '''
        
        '''
        if not names:
            sys.exit('Please provide generator names')
        for name in names:
            name, count = name, 0
            if ':' in name:
                name, count = name.split(':', 1)
            count = int(count)
            create = self.generators[name]
            print('Generating `{0}` count={1}'.format(name, count))
            create(self.session, count)
            self.session.commit()
221581
public void reserve(String name) {
    checkName(name);
    // if this is new
    if (reserved.add(name)) {
      // add it to names, so that generateName will still work for reserved names (they will just
      // get suffixes).
      if (!names.add(name)) {
        names.remove(name);
        throw new IllegalArgumentException("newly reserved name: " + name + " was already used!");
      }
    }
  }
359390
async function generate(options = {}) {
  options = Object.assign(DEFAULT_OPTIONS, options)

  // Log start
  let msg = `Generating font kit from ${ options.paths.length } SVG icons`.yellow
  log(options, msg)

  // Run validation over options
  await validateOptions(options)

  if (options.codepoints) {
    options.codepointsMap = await getCodepointsMap(options.codepoints)
  }

  // Run font generation
  const config = getGeneratorConfig(options)
  const generatorResult = await fontGenerator(config)

  // Clean up after generator
  await deleteUnspecifiedTypes(options)

  // If specified, generate JSON map
  if (options.json) {
    await generateJson(options, generatorResult)
  }

  // Log generated files
  logReport(options)
}
69584
def generator_name(cls):
		
		if cls.__generator_name__ is None:
			raise ValueError('"__generator_name__" should be override in a derived class')
		if isinstance(cls.__generator_name__, str) is False:
			raise TypeError('"__generator_name__" should be a str instance')
		return cls.__generator_name__.upper()
224127
protected function runGenerator($name, array $config, array $args)
    {
        echo $this->renderVersion();

        if (!isset($args[0])) {
            $this->usageError("You must specify a subject for what you are generating.");
        }

        list ($config['context'], $config['subject']) = strpos($args[0], ':') !== false
            ? explode(':', $args[0])
            : array('app', $args[0]);

        echo Line::begin('Running generator', Line::YELLOW)->nl();
        echo Line::begin()
            ->indent(2)
            ->text("Generating $name '{$args[0]}'.")
            ->nl(2);

        $generator = Generator::create($name, $config);

        if (!$generator->validate()) {
            $generator->renderErrors();
        }

        $files = $generator->generate();

        $this->save($files);
    }
309489
public void addGenerator(Distribution gen) {
    if(trans != null) {
      throw new AbortException("Generators may no longer be added when transformations have been applied.");
    }
    axes.add(gen);
    dim++;
  }
409191
def run(ast)
      ast = [ast] unless ast.is_a?(Array)

      # pre-load all the built-in definitions.
      @constant_loader.run(ast)

      ast.each { |node| iterate(node) }

      freeze
    end
792757
public void addGenerator(IdGenerator generator) {
		checkReadOnly();
		DialectException.assureNotNull(generator);
		DialectException.assureNotNull(generator.getGenerationType());
		DialectException.assureNotEmpty(generator.getIdGenName(), "IdGenerator name can not be empty");
		getIdGenerators().add(generator);
	}