Example #1
0
 @Override
 public String getCode(MapContainsKeyCall mapContainsKeyCall) {
   return String.format(
       "%s.ContainsKey(%s)",
       mapContainsKeyCall.getExpression(),
       GeneratorHelper.joinParams(mapContainsKeyCall.getParameters()));
 }
Example #2
0
 @Override
 public String getCode(ParentCall parentCall) {
   String out = "base(";
   if (parentCall.getParameters() != null) {
     out += GeneratorHelper.joinParams(parentCall.getParameters());
   }
   out += ")";
   return out;
 }
Example #3
0
  @Override
  public String getCode(Meth meth) {

    // #join ( $method.Modifiers " ") #if($method.isInherited())override#end
    // $method.Type $method.Name ( #params( $method.getParams() ) )

    String name = replaceMethodName(meth, meth.getName());

    customizeModifiers(meth);

    return String.format(
        "%s %s %s(%s)",
        getCode(meth.getModifiers()),
        meth.getType(),
        name,
        GeneratorHelper.joinParams(meth.getParams()));
  }
Example #4
0
 /**
  * Produces code for an object instantiation.
  *
  * @param classNew the object instantiation node.
  * @return the formatted object instantiation.
  */
 public String getCode(ClassNew classNew) {
   return String.format(
       "new %s( %s )", classNew.getName(), GeneratorHelper.joinParams(classNew.getParameters()));
 }
Example #5
0
 @Override
 public String getCode(EqualsCall equalsCall) {
   return String.format(
       "%s.Equals(%s)",
       equalsCall.getTarget(), GeneratorHelper.joinParams(equalsCall.getParameters()));
 }
Example #6
0
 @Override
 public String getCode(MapGetCall mapGetCall) {
   return String.format(
       "%s[%s]",
       mapGetCall.getExpression(), GeneratorHelper.joinParams(mapGetCall.getParameters()));
 }
Example #7
0
 @Override
 public String getCode(SystemOutPrintCall systemOutPrintCall) {
   return String.format(
       "Console.WriteLine(%s)", GeneratorHelper.joinParams(systemOutPrintCall.getParameters()));
 }
Example #8
0
 @Override
 public String getCode(ListGetCall lgc) {
   return String.format(
       "%s[%s]", lgc.getExpression(), GeneratorHelper.joinParams(lgc.getParameters()));
 }
Example #9
0
 @Override
 public String getCode(ListContainsCall lcc) {
   return String.format(
       "%s.Contains(%s)", lcc.getExpression(), GeneratorHelper.joinParams(lcc.getParameters()));
 }
Example #10
0
 @Override
 public String getCode(ListRemoveAtCall lrc) {
   return String.format(
       "%s.RemoveAt(%s)", lrc.getExpression(), GeneratorHelper.joinParams(lrc.getParameters()));
 }
Example #11
0
 @Override
 public String getCode(ListAddCall lac) {
   String method = lac.getParameters().size() > 1 ? "Insert" : "Add";
   return String.format(
       "%s.%s(%s)", lac.getExpression(), method, GeneratorHelper.joinParams(lac.getParameters()));
 }