Skip to content

Commit c4f83ea

Browse files
author
Troy Melhase
committed
Getting closer to release...
1 parent cbd934a commit c4f83ea

File tree

2 files changed

+44
-24
lines changed

2 files changed

+44
-24
lines changed

doc/customization.md

Lines changed: 41 additions & 22 deletions
Original file line numberDiff line numberDiff line change
@@ -8,6 +8,23 @@ line. See the [usage][] page for instructions on specifying additional configs.
88
The default configuration module is `java2python.config.default`. Refer to [the source
99
of that module][1] for its values and additional descriptions.
1010

11+
### Usage
12+
13+
To change the behavior of some or all of the config items, create a Python
14+
file, define the items you want, and specify that file when invoking `j2py`.
15+
16+
For example, if you would like to change the comment prefix to `##`, you might
17+
do this:
18+
19+
$ echo "indentPrefix = '##'" >> myconfig.py
20+
21+
Then run the script:
22+
23+
$ j2py SomeJavaSource.java -c myconfig.py
24+
25+
The config files are Python modules, so you can use the full power of Python
26+
when writing your configurations.
27+
1128
### A Note About Some of the Names: Prologue, Base, Head, and Epilogue
1229

1330
When a config point has `Prologue` in its name, it means that the item will be
@@ -31,38 +48,40 @@ be responsible for generating code after the body of the item. The only
3148
recognized epilogue config point is `moduleEpilogueHandlers`, which generates a
3249
main script stanza if necessary.
3350

51+
52+
3453
### Customization Points
3554

36-
* indentPrefix
37-
* commentPrefix
38-
* expressionVariableNamingHandler
55+
#### <a name="indentPrefix"></a>indentPrefix
56+
#### <a name="commentPrefix"></a>commentPrefix
57+
#### <a name="expressionVariableNamingHandler"></a>expressionVariableNamingHandler
3958

40-
* modulePrologueHandlers
41-
* moduleEpilogueHandlers
42-
* moduleOutputHandlers
43-
* modulePackageDeclarationHandler
44-
* moduleImportDeclarationHandler
45-
* moduleOutputSubs
59+
#### <a name="modulePrologueHandlers"></a>modulePrologueHandlers
60+
#### <a name="moduleEpilogueHandlers"></a>moduleEpilogueHandlers
61+
#### <a name="moduleOutputHandlers"></a>moduleOutputHandlers
62+
#### <a name="modulePackageDeclarationHandler"></a>modulePackageDeclarationHandler
63+
#### <a name="moduleImportDeclarationHandler"></a>moduleImportDeclarationHandler
64+
#### <a name="moduleOutputSubs"></a>moduleOutputSubs
4665

4766

48-
* classHeadHandlers
49-
* classBaseHandlers
50-
* classPostWalkHandlers
67+
#### <a name="classHeadHandlers"></a>classHeadHandlers
68+
#### <a name="classBaseHandlers"></a>classBaseHandlers
69+
#### <a name="classPostWalkHandlers"></a>classPostWalkHandlers
5170

52-
* interfaceBaseHandlers
53-
* interfaceHeadHandlers
71+
#### <a name="interfaceBaseHandlers"></a>interfaceBaseHandlers
72+
#### <a name="interfaceHeadHandlers"></a>interfaceHeadHandlers
5473

55-
* enumHeadHandlers
56-
* enumValueHandler
74+
#### <a name="enumHeadHandlers"></a>enumHeadHandlers
75+
#### <a name="enumValueHandler"></a>enumValueHandler
5776

5877

59-
* methodParamHandlers
60-
* methodLockFunctionName
61-
* methodHeadHandlers
62-
* methodPrologueHandlers
78+
#### <a name="methodParamHandlers"></a>methodParamHandlers
79+
#### <a name="methodLockFunctionName"></a>methodLockFunctionName
80+
#### <a name="methodHeadHandlers"></a>methodHeadHandlers
81+
#### <a name="methodPrologueHandlers"></a>methodPrologueHandlers
6382

64-
* astTransforms
65-
* typeSubs
83+
#### <a name="astTransforms"></a>astTransforms
84+
#### <a name="typeSubs"></a>typeSubs
6685

6786

6887
[usage]: https://github.com/natural/java2python/tree/master/doc/usage.md

doc/intro.md

Lines changed: 3 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -95,10 +95,11 @@ explanation and enumeration see the [features][] page.
9595

9696
### Why Bother?
9797

98-
I bothered to write this because I needed a Java package to run on the CPython
99-
interpreter. I got tired of porting by hand, so I wrote this instead. And
98+
I bothered to write this because [I needed a Java package][1] to run on the CPython
99+
interpreter. I got tired of porting by hand so I wrote this instead. And
100100
it's an interesting problem (kind of).
101101

102102

103103
[ANTLR]: http://www.antlr.org
104104
[features]: https://github.com/natural/java2python/tree/master/doc/features.md
105+
[1]: http://roundrockriver.wordpress.com/2007/02/15/automated-translation-of-java-to-python/

0 commit comments

Comments
 (0)