예제 #1
0
 @Override
 public String getCode(MapContainsKeyCall mapContainsKeyCall) {
   return String.format(
       "%s.ContainsKey(%s)",
       mapContainsKeyCall.getExpression(),
       GeneratorHelper.joinParams(mapContainsKeyCall.getParameters()));
 }
예제 #2
0
 @Override
 public String getCode(ParentCall parentCall) {
   String out = "base(";
   if (parentCall.getParameters() != null) {
     out += GeneratorHelper.joinParams(parentCall.getParameters());
   }
   out += ")";
   return out;
 }
예제 #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()));
  }
예제 #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()));
 }
예제 #5
0
 @Override
 public String getCode(EqualsCall equalsCall) {
   return String.format(
       "%s.Equals(%s)",
       equalsCall.getTarget(), GeneratorHelper.joinParams(equalsCall.getParameters()));
 }
예제 #6
0
 @Override
 public String getCode(MapGetCall mapGetCall) {
   return String.format(
       "%s[%s]",
       mapGetCall.getExpression(), GeneratorHelper.joinParams(mapGetCall.getParameters()));
 }
예제 #7
0
 @Override
 public String getCode(SystemOutPrintCall systemOutPrintCall) {
   return String.format(
       "Console.WriteLine(%s)", GeneratorHelper.joinParams(systemOutPrintCall.getParameters()));
 }
예제 #8
0
 @Override
 public String getCode(ListGetCall lgc) {
   return String.format(
       "%s[%s]", lgc.getExpression(), GeneratorHelper.joinParams(lgc.getParameters()));
 }
예제 #9
0
 @Override
 public String getCode(ListContainsCall lcc) {
   return String.format(
       "%s.Contains(%s)", lcc.getExpression(), GeneratorHelper.joinParams(lcc.getParameters()));
 }
예제 #10
0
 @Override
 public String getCode(ListRemoveAtCall lrc) {
   return String.format(
       "%s.RemoveAt(%s)", lrc.getExpression(), GeneratorHelper.joinParams(lrc.getParameters()));
 }
예제 #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()));
 }