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