示例#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()));
 }