Examples of Macro


Examples of aQute.bnd.osgi.Macro

                    }
                    String version = parts[1];
                    if (!version.startsWith("[") && !version.startsWith("(")) {
                        Processor processor = new Processor();
                        processor.setProperty("@", VersionTable.getVersion(version).toString());
                        Macro macro = new Macro(processor);
                        version = macro.process("${range;[==,=+)}");
                    }
                    VersionRange range = new VersionRange(version);
                    Map<String, String> hdrs = ranges.get(range);
                    if (hdrs == null) {
                        hdrs = new HashMap<String, String>();
View Full Code Here

Examples of com.google.clearsilver.jsilver.template.Macro

   * the local variables defined by the parameters of the macro definition
   */
  @Override
  public void caseACallCommand(ACallCommand node) {
    String macroName = makeWord(node.getMacro());
    Macro macro = context.findMacro(macroName);

    // Make sure that the number of arguments passed to the macro match the
    // number expected.
    if (node.getArguments().size() != macro.getArgumentCount()) {
      throw new JSilverInterpreterException("Number of arguments to macro " + macroName + " ("
          + node.getArguments().size() + ") does not match " + "number of expected arguments ("
          + macro.getArgumentCount() + ")");
    }

    int numArgs = node.getArguments().size();
    if (numArgs > 0) {
      Value[] argValues = new Value[numArgs];

      // We must first evaluate the parameters we are passing or there could be
      // conflicts if new argument names match existing variables.
      Iterator<PExpression> argumentValues = node.getArguments().iterator();
      for (int i = 0; argumentValues.hasNext(); i++) {
        argValues[i] = expressionEvaluator.evaluate(argumentValues.next());
      }

      // No need to bother pushing and popping the variable scope stack
      // if there are no new local variables to declare.
      dataContext.pushVariableScope();

      for (int i = 0; i < argValues.length; i++) {
        setTempVariable(macro.getArgumentName(i), argValues[i]);
      }
    }
    try {
      macro.render(context);
    } catch (IOException e) {
      throw new JSilverIOException(e);
    }
    if (numArgs > 0) {
      // No need to bother pushing and popping the variable scope stack
View Full Code Here

Examples of lineage2.gameserver.model.actor.instances.player.Macro

      int d1 = readD();
      int d2 = readC();
      String command = readS().replace(";", "").replace(",", "");
      commands[i] = new L2MacroCmd(entry, type, d1, d2, command);
    }
    _macro = new Macro(_id, _icon, _name, _desc, _acronym, commands);
  }
View Full Code Here

Examples of net.asfun.jangod.lib.Macro

  String endName = null;

  public MacroNode(MacroToken token) throws ParseException{
    super();
    master = token;
    Macro macro = MacroLibrary.getMacro(master.getMacroName());
    if ( macro == null ) {
      throw new ParseException("Can't find macro >>> " + master.getMacroName());
    }
    endName = macro.getEndMacroName();
  }
View Full Code Here

Examples of net.sf.laja.template.Macro

  @Override
  public ILocal createLocal(ITemplate itemplate, IMacro imacro, IFunction ifunction) {
    if (imacro == null && ifunction == null) {
      throw new LajaException("#local variables can not exist outside a #macro or #function body.");
    }
    Macro macro = (Macro) imacro;

    if (macro == null) {
      macro = (Macro) ifunction;
    }
    return new Set(source, namespaces, templateTextWriter, macro, macro.getLocalContext());
  }
View Full Code Here

Examples of net.sf.laja.template.Macro

  }

  @Override
  public IMacro createMacro(ITemplate itemplate) {
    Template template = (Template) itemplate;
    return new Macro(false, source, namespaces, templateTextWriter, template.getContext());
  }
View Full Code Here

Examples of net.sf.laja.template.Macro

  }

  @Override
  public IFunction createFunction(ITemplate itemplate) {
    Template template = (Template) itemplate;
    return new Macro(true, source, namespaces, templateTextWriter, template.getContext());
  }
View Full Code Here

Examples of net.sf.laja.template.Macro

 
  private boolean isMacro(Context context, boolean isFunction) {
    if (!isMethodRef()) {
      return false;
    }
    Macro macro = getMacro(context);
   
   
    return macro != null && macro.isFunction() == isFunction;
  }
View Full Code Here

Examples of net.sf.laja.template.Macro

   
    return macro != null && macro.isFunction() == isFunction;
  }
 
  public Macro getMacro(Context context) {
    Macro macro = context.getMacro(getMethodName());
   
    if (macro == null && !namespaces.isDefaultNamespace(context)) {
      // If macro not found in specified namespace, also look in default namespace
      macro = namespaces.getDefaultNamespace().getMacro(getMethodName());
    }   
View Full Code Here

Examples of net.sf.laja.template.Macro

    return context.evaluate(attributeRef);
  }

  private Object getResultFromCurrentOrDefaultNamespace() {
    if (attributeRef.isMethodRef()) {
      Macro macro = context.getMacro(attributeRef.getMethodName());
     
      if (macro == null && !namespaces.isDefaultNamespace(context)) {
        return namespaces.getDefaultNamespace().evaluateMacro(attributeRef);
      }
     
View Full Code Here
TOP
Copyright © 2018 www.massapi.com. All rights reserved.
All source code are property of their respective owners. Java is a trademark of Sun Microsystems, Inc and owned by ORACLE Inc. Contact coftware#gmail.com.