Пример #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()));
 }