Examples of Outputmethod


Examples of net.sf.laja.parser.grammar.element.Outputmethod

    }
  }


  public String getOutputVarName(int phase, String var1, String var2, String var2b, String origVar) {
    Outputmethod om1 = new Outputmethod();
    Outputmethod om2 = new Outputmethod();

    om1.setRef(var1);
    om1.setArg(var2);
    om2.setRef(var1);
    om2.setArg(var2b);

    for (Output output : list) {
      if (output.isSameOutputclass(om1) || output.isSameOutputclass(om2)) {
        if (output.isOutputClass(phase)) {
          return output.getVariableName(phase);
View Full Code Here

Examples of net.sf.laja.parser.grammar.element.Outputmethod

    return "";
  }
 
  public void print(int phase) {
    for (Output output : list) {
      Outputmethod om = output.getFirstOutputmethod();
      String setter = om.isVariableSetter() ? "$ " : "";
      System.out.println("# " + setter + om + ", argClass=" + om.getArgClass() + ", argVariableSetter=" + output.isArgVariableSetter(phase) + ", variableSetter=" + output.isVariableSetter() + ", argClassVariableSetter=" + output.isArgClassVariableSetter() + ", argClassVariableDef="
          + output.isArgClassVariableDef());
      output.print();
    }
  }
View Full Code Here

Examples of net.sf.laja.parser.grammar.element.Outputmethod

    }
  }

  public void init() {
    for (Output output : list) {
      Outputmethod om = output.getFirstOutputmethod();
      if (!om.isDefined()) {
        if (ovSet.isReference(om.getArgName())) {
          output.getFirstOutputmethod().setVariableSetter();
        }
      }
      // Markera alla primitiva set-metoder som refererar till klasser.
      Ref ref = refList.getRef(om.getOrigArgName());
      if (om.isDefined() && !om.isClass() && ref != null) {
        om.setClassRef(ref.getClassName());
      }
      for (Iterator i = omList.iterator(); i.hasNext();) {
        Outputmethod om2 = (Outputmethod) i.next();
        if (om.isSameOutputclass(om2)) {
          output.add(om2);
        }
      }
    }

    // S�tt flagga "hasOutputMethod" om metod finns deklarerad.
    for (Iterator<Ref> i = refList.iterator(); i.hasNext();) {
      Ref ref = i.next();
      if (omList.get(ref.getRefname()) != null) {
        ref.setHasOutputMethod(true);
      }
    }

    Map<Refdata, Refdata> refdataMap = omList.getRefdataMap();
    for (Refdata refdata : refdataMap.values()) {
      Ref ref = refList.getRef(refdata.getOrigVar());
      if (ref != null && ref.isHasOutputMethod()) {
        // Nu har vi hittat en referens som �r ett objekt med metoder,
        // t ex:
        // valx = ... integer ...;
        // Integer integer.setInt(String *);
        // D� integer i valx-definitionen �r ett objekt, kommer
        // Outputklassen f�r Integer att g�ra "peekInteger().setInt(..),
        // d�rf�r m�ste antingen en set-metod f�r valx.integer vara
        // definierad, detta kan g�ras �t anv�ndare d� det inte ska vara
        // tvingande, exempel:
        // valx.setInteger(Integer integer);
        // Observera att man m�ste ta h�nsyn till hur variabeln refereras,
        // T ex ska satsen...
        // kalle = (integer:idx1):idx2 integer;
        // ...refereras b�de med idx2 och integer.
        Outputmethod om = new Outputmethod();
        om.setRef(refdata.getVar1());
        om.setArgClass(ref.getClassName());
        om.setArg(ref.getRefname());
        Ref varRef = refList.getRef(refdata.getVar1());
        if (varRef == null) {
          System.out.println("Error. The variable '" + refdata.getVar1() +
                      "' must be declared, e.g: " + StringUtils.capitalize(refdata.getVar1()) + " " + refdata.getVar1() + ";");
        } else {
          om.setClass(varRef.getClassName());
        }

        Output output = new Output(omList, ovSet, refList, om, refdata);
        list.add(output);
      }
View Full Code Here

Examples of net.sf.laja.parser.grammar.element.Outputmethod

    return new Omarg();
  }

  @Override
  public IOutputmethod createOutputmethod(IGrammar grammar) {
    return new Outputmethod((Row)grammar);
  }
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.