CS2J:TheUserGuide
CS2J:TheUserGuide
Trialversion
Overview
Runningthetranslator
Visualizingthetranslation
Excludingpaths
Dumpingthetranslationrepository
Guidingthetranslationprocess(addingCheats)
CS2JParameters
.NETFrameworktranslations
Translationfiles
AppendixAConfigurationFile
Section[General]
Section[Experimental]
Trialversion
ThetrialversionofCS2Jmaybeusedforevaluationpurposesonly.Ithassomeusage
restrictionscomparedtothefullproduct:
1. Javaclassesaretruncatedat120lines.
2. TheXMLtranslationfilesaresigned.Youcanmakemodifications,oraddnew
translationfiles,andthesewillbeusedbyCS2Jaslongasthereare5orless
translationfileswithoutvalidsignatures.Ifyouhitthislimit,thenjustrestore
someoftheoriginaltranslationfilesandtryagain.
Overview
CS2JisaC#applicationthatconvertsC#types(classes,structs,enums,delegates)to
Javatypes(classesandenums).
ThetranslatorfirstcrawlsoverthewholeoftheC#applicationandbuildsupaninternal
datastructure,calledthetranslationrepository,thatstorestranslationmetadataforallthe
application'sclasses,structs,enums,etc.ItthenextendsthisrepositoryfromXMLfiles
thataddtranslationmetadatafor.NETFrameworksystemcallsandthirdpartylibraries
usedbytheapplication.Usingthistranslationrepositoryitthentakeseachclass,struct,
enum,andsoon,fromtheapplicationandtranslatesittoJava:
1. TranslatetheC#sourceintoaC#parsetree.
2. TranslatetheC#parsetreeintoaJava(ish)parsetree.ThisconvertsC#syntax
intoJavasyntax,itdoesn'ttranslatemethodcallsordoanytranslationsthat
dependontypes.
3. GeneratetypesforthenodesintheJava(ish)parsetreeandusethetranslation
repositorytotranslatetypesandmethodcallsintotheirJavaequivalent.
4. PrettyprinttheJavaparsetreetoJavasourcefiles(onepertopleveltypeinthe
C#sourcefile).
Runningthetranslator
CS2JisaWindowsexecutablethatcanberunfromthecommandline.(Thereisalsoa
GUIlauncherwhichisnotyetdescribedinthisdocument,askfordetails).