Permalink
Browse files

further tweaks to the formatting of the README files

  • Loading branch information...
1 parent 34f8930 commit 0ae14fe99d2805c5d107f9c884f7ad0ade888962 Kyle Yetter committed May 29, 2011
Showing with 67 additions and 68 deletions.
  1. +45 −45 DEVELOPER-README.rdoc
  2. +22 −23 README.rdoc
View
@@ -23,12 +23,12 @@ I'll try to help you out as I can.
1. pull the repository
- git clone git://rubyforge.org/antlr3.git
+ git clone git://rubyforge.org/antlr3.git
2. Modify your PATH environmental variable to add the following directories:
- $base/bin $base/scripts $base/vendor/gems/ruby-1.8/bin
-
+ $base/bin $base/scripts $base/vendor/gems/ruby-1.8/bin
+
where $base is the absolute path of the project's base directory.
If you use a bash-flavored shell, you can do this by running:
@@ -114,7 +114,7 @@ http://github.com/jbarnette/isolate
output until the ANTLR jar is updated with the changes. The
jar can be updated via:
- rake antlr
+ rake antlr
=== Testing
@@ -164,12 +164,12 @@ http://github.com/jbarnette/isolate
java/antlr-full-3.x.x.jar in the project directory
and then essentially runs:
- java -jar path/to/antlr-full-3.x.x.jar ARGV
+ java -jar path/to/antlr-full-3.x.x.jar ARGV
* so to use ANTLR to generate ruby output using this project's
runtime library and code templates, run:
- antlr4ruby [antlr options] path/to/Grammar.g
+ antlr4ruby [antlr options] path/to/Grammar.g
* run antlr4ruby without arguments to get a summary of
ANTLR's options and arguments, or read up on the
@@ -186,17 +186,17 @@ http://github.com/jbarnette/isolate
* examples:
- # run functional tests
- antlr-tests functional
-
- # run unit, functional, benchmarking, and profiling tests:
- antlr-tests run
-
- # trash all files generated by the tests
- antlr-tests clean
-
- # run all parser-oriented tests
- antlr-tests functional parser
+ # run functional tests
+ antlr-tests functional
+
+ # run unit, functional, benchmarking, and profiling tests:
+ antlr-tests run
+
+ # trash all files generated by the tests
+ antlr-tests clean
+
+ # run all parser-oriented tests
+ antlr-tests functional parser
=== grammar-tools
@@ -206,21 +206,21 @@ http://github.com/jbarnette/isolate
* a few notable commands:
- # produce a fairly nice HTML-formatted grammar display
- grammar-tools format html path/to/Grammar.g > grammar.html
-
- # list all rule names defined within a grammar
- grammar-tools show rules path/to/Grammar.g
-
- # set up a grammar targetted for a language other than
- # ruby to be retargetted for ruby output
- grammar-tools modify stylize path/to/Grammar.g
-
- # print out a grammar without any language-specific elements
- grammar-tools modify strip path/to/Grammar.g
-
- # print out help with a list of commands
- grammar-tools help
+ # produce a fairly nice HTML-formatted grammar display
+ grammar-tools format html path/to/Grammar.g > grammar.html
+
+ # list all rule names defined within a grammar
+ grammar-tools show rules path/to/Grammar.g
+
+ # set up a grammar targetted for a language other than
+ # ruby to be retargetted for ruby output
+ grammar-tools modify stylize path/to/Grammar.g
+
+ # print out a grammar without any language-specific elements
+ grammar-tools modify strip path/to/Grammar.g
+
+ # print out help with a list of commands
+ grammar-tools help
=== st-group
@@ -230,17 +230,17 @@ http://github.com/jbarnette/isolate
* current notable commands:
- # break up a large STG file into a directory containing a single .st
- # file for each template defined in a group
- st-group unzip path/to/Group.stg
-
- # reconstitute a directory created by unzipping a group file
- # back into a single .stg file
- st-group zip path/to/Group/
-
- # print out names and other definition info contained in a .stg file
- st-group info path/to/Group.stg
-
- # extract and display a single template definition
- st-group show path/to/Group.stg templateName
+ # break up a large STG file into a directory containing a single .st
+ # file for each template defined in a group
+ st-group unzip path/to/Group.stg
+
+ # reconstitute a directory created by unzipping a group file
+ # back into a single .stg file
+ st-group zip path/to/Group/
+
+ # print out names and other definition info contained in a .stg file
+ st-group info path/to/Group.stg
+
+ # extract and display a single template definition
+ st-group show path/to/Group.stg templateName
View
@@ -61,37 +61,36 @@ ANTLR provides for other language targets, such as Java and Python. It contains:
1. Write an ANTLR grammar specification for a language
- grammar SomeLanguage;
-
- options {
- language = Ruby; // <- this option must be set to Ruby
- output = AST;
- }
-
- top: expr ( ',' expr )*
- ;
-
- and so on...
+ grammar SomeLanguage;
+
+ options {
+ language = Ruby; // <- this option must be set to Ruby
+ output = AST;
+ }
+
+ top: expr ( ',' expr )*
+ ;
+
+ and so on...
2. Run the ANTLR tool with the antlr4ruby command to generate output:
- antlr4ruby SomeLanguage.g
- # creates:
- # SomeLanguageParser.rb
- # SomeLanguageLexer.rb
- # SomeLanguage.g
+ antlr4ruby SomeLanguage.g
+ # creates:
+ # SomeLanguageParser.rb
+ # SomeLanguageLexer.rb
+ # SomeLanguage.g
3. Try out the results directly, if you like:
- # see how the lexer tokenizes some input
- ruby SomeLanguageLexer.rb < path/to/source-code.xyz
-
- # check whether the parser successfully matches some input
- ruby SomeLanguageParser.rb --rule=top < path/to/source-code.xyz
+ # see how the lexer tokenizes some input
+ ruby SomeLanguageLexer.rb < path/to/source-code.xyz
+
+ # check whether the parser successfully matches some input
+ ruby SomeLanguageParser.rb --rule=top < path/to/source-code.xyz
--> Read up on the package documentation for more specific details
- about loading the recognizers and using their class definitions
+Read up on the package documentation for more specific details about loading the recognizers and using their class definitions
== ISSUES

0 comments on commit 0ae14fe

Please sign in to comment.