geronimo-scm mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From jdil...@apache.org
Subject svn commit: r572187 - in /geronimo/sandbox/gshell/trunk: ./ gshell-core/ gshell-core/src/main/grammar/ gshell-core/src/main/java/org/apache/geronimo/gshell/ gshell-core/src/main/java/org/apache/geronimo/gshell/commandline/ gshell-core/src/test/java/org...
Date Sun, 02 Sep 2007 23:19:32 GMT
Author: jdillon
Date: Sun Sep  2 16:19:30 2007
New Revision: 572187

URL: http://svn.apache.org/viewvc?rev=572187&view=rev
Log:
Moved the javacc parser bits to gshell-parser

Added:
    geronimo/sandbox/gshell/trunk/gshell-parser/src/main/grammar/
      - copied from r572186, geronimo/sandbox/gshell/trunk/gshell-core/src/main/grammar/
    geronimo/sandbox/gshell/trunk/gshell-parser/src/main/java/org/apache/geronimo/gshell/parser/ASTOpaqueString.java   (contents, props changed)
      - copied, changed from r572186, geronimo/sandbox/gshell/trunk/gshell-core/src/main/java/org/apache/geronimo/gshell/commandline/parser/ASTOpaqueString.java
    geronimo/sandbox/gshell/trunk/gshell-parser/src/main/java/org/apache/geronimo/gshell/parser/ASTPlainString.java   (contents, props changed)
      - copied, changed from r572186, geronimo/sandbox/gshell/trunk/gshell-core/src/main/java/org/apache/geronimo/gshell/commandline/parser/ASTPlainString.java
    geronimo/sandbox/gshell/trunk/gshell-parser/src/main/java/org/apache/geronimo/gshell/parser/ASTQuotedString.java   (contents, props changed)
      - copied, changed from r572186, geronimo/sandbox/gshell/trunk/gshell-core/src/main/java/org/apache/geronimo/gshell/commandline/parser/ASTQuotedString.java
    geronimo/sandbox/gshell/trunk/gshell-parser/src/main/java/org/apache/geronimo/gshell/parser/CommandLineParserSupport.java   (contents, props changed)
      - copied, changed from r572186, geronimo/sandbox/gshell/trunk/gshell-core/src/main/java/org/apache/geronimo/gshell/commandline/parser/CommandLineParserSupport.java
    geronimo/sandbox/gshell/trunk/gshell-parser/src/main/java/org/apache/geronimo/gshell/parser/NodeSupport.java   (contents, props changed)
      - copied, changed from r572186, geronimo/sandbox/gshell/trunk/gshell-core/src/main/java/org/apache/geronimo/gshell/commandline/parser/NodeSupport.java
    geronimo/sandbox/gshell/trunk/gshell-parser/src/main/java/org/apache/geronimo/gshell/parser/StringSupport.java   (contents, props changed)
      - copied, changed from r572186, geronimo/sandbox/gshell/trunk/gshell-core/src/main/java/org/apache/geronimo/gshell/commandline/parser/StringSupport.java
    geronimo/sandbox/gshell/trunk/gshell-parser/src/main/java/org/apache/geronimo/gshell/parser/package-info.java   (with props)
    geronimo/sandbox/gshell/trunk/gshell-parser/src/test/java/org/apache/geronimo/gshell/parser/CommandLineParserVisitorTest.java   (contents, props changed)
      - copied, changed from r572186, geronimo/sandbox/gshell/trunk/gshell-core/src/test/java/org/apache/geronimo/gshell/commandline/parser/CommandLineParserVisitorTest.java
Removed:
    geronimo/sandbox/gshell/trunk/gshell-core/src/main/grammar/
    geronimo/sandbox/gshell/trunk/gshell-core/src/main/java/org/apache/geronimo/gshell/commandline/
    geronimo/sandbox/gshell/trunk/gshell-core/src/test/java/org/apache/geronimo/gshell/commandline/
    geronimo/sandbox/gshell/trunk/gshell-parser/src/main/grammar/SyntaxParser.jtb
Modified:
    geronimo/sandbox/gshell/trunk/gshell-core/pom.xml
    geronimo/sandbox/gshell/trunk/gshell-core/src/main/java/org/apache/geronimo/gshell/CommandLineBuilder.java
    geronimo/sandbox/gshell/trunk/gshell-core/src/main/java/org/apache/geronimo/gshell/CommandManagerImpl.java
    geronimo/sandbox/gshell/trunk/gshell-core/src/main/java/org/apache/geronimo/gshell/ExecutingVisitor.java
    geronimo/sandbox/gshell/trunk/gshell-core/src/main/java/org/apache/geronimo/gshell/JLineConsole.java
    geronimo/sandbox/gshell/trunk/gshell-core/src/main/java/org/apache/geronimo/gshell/LoggingVisitor.java
    geronimo/sandbox/gshell/trunk/gshell-core/src/main/java/org/apache/geronimo/gshell/Shell.java
    geronimo/sandbox/gshell/trunk/gshell-core/src/test/java/org/apache/geronimo/gshell/CommandLineBuilderTest.java
    geronimo/sandbox/gshell/trunk/gshell-core/src/test/java/org/apache/geronimo/gshell/CommandManagerImplTest.java
    geronimo/sandbox/gshell/trunk/gshell-core/src/test/java/org/apache/geronimo/gshell/ExecutingVisitorTest.java
    geronimo/sandbox/gshell/trunk/gshell-core/src/test/java/org/apache/geronimo/gshell/VariablesImplTest.java
    geronimo/sandbox/gshell/trunk/gshell-parser/pom.xml
    geronimo/sandbox/gshell/trunk/gshell-parser/src/main/grammar/CommandLineParser.jjt
    geronimo/sandbox/gshell/trunk/gshell-parser/src/test/java/org/apache/geronimo/gshell/parser/CommandLineParserTest.java
    geronimo/sandbox/gshell/trunk/pom.xml

Modified: geronimo/sandbox/gshell/trunk/gshell-core/pom.xml
URL: http://svn.apache.org/viewvc/geronimo/sandbox/gshell/trunk/gshell-core/pom.xml?rev=572187&r1=572186&r2=572187&view=diff
==============================================================================
--- geronimo/sandbox/gshell/trunk/gshell-core/pom.xml (original)
+++ geronimo/sandbox/gshell/trunk/gshell-core/pom.xml Sun Sep  2 16:19:30 2007
@@ -51,6 +51,12 @@
         </dependency>
 
         <dependency>
+            <groupId>org.apache.geronimo.gshell</groupId>
+            <artifactId>gshell-parser</artifactId>
+            <version>${pom.version}</version>
+        </dependency>
+
+        <dependency>
             <groupId>jline</groupId>
             <artifactId>jline</artifactId>
         </dependency>
@@ -71,48 +77,5 @@
             <scope>test</scope>
         </dependency>
     </dependencies>
-
-    <build>
-        <plugins>
-            <plugin>
-                <groupId>org.apache.geronimo.gshell</groupId>
-                <artifactId>javacc-maven-plugin</artifactId>
-                <version>${pom.version}</version>
-                <executions>
-                    <execution>
-                        <id>jjtree</id>
-                        <phase>generate-sources</phase>
-                        <goals>
-                            <goal>jjtree</goal>
-                        </goals>
-                        <configuration>
-                            <grammars>
-                                <directory>${project.basedir}/src/main/grammar</directory>
-                                <includes>
-                                    <include>*.jjt</include>
-                                </includes>
-                            </grammars>
-                        </configuration>
-                    </execution>
-                    
-                    <execution>
-                        <id>javacc</id>
-                        <phase>generate-sources</phase>
-                        <goals>
-                            <goal>javacc</goal>
-                        </goals>
-                        <configuration>
-                            <grammars>
-                                <directory>${project.build.directory}/generated-sources/jjtree</directory>
-                                <includes>
-                                    <include>*.jj</include>
-                                </includes>
-                            </grammars>
-                        </configuration>
-                    </execution>
-                </executions>
-            </plugin>
-        </plugins>
-    </build>
     
 </project>

Modified: geronimo/sandbox/gshell/trunk/gshell-core/src/main/java/org/apache/geronimo/gshell/CommandLineBuilder.java
URL: http://svn.apache.org/viewvc/geronimo/sandbox/gshell/trunk/gshell-core/src/main/java/org/apache/geronimo/gshell/CommandLineBuilder.java?rev=572187&r1=572186&r2=572187&view=diff
==============================================================================
--- geronimo/sandbox/gshell/trunk/gshell-core/src/main/java/org/apache/geronimo/gshell/CommandLineBuilder.java (original)
+++ geronimo/sandbox/gshell/trunk/gshell-core/src/main/java/org/apache/geronimo/gshell/CommandLineBuilder.java Sun Sep  2 16:19:30 2007
@@ -22,12 +22,9 @@
 import java.io.Reader;
 import java.io.StringReader;
 
-import org.apache.geronimo.gshell.commandline.parser.ASTCommandLine;
-import org.apache.geronimo.gshell.commandline.parser.CommandLineParser;
-import org.apache.geronimo.gshell.commandline.parser.ParseException;
-import org.apache.geronimo.gshell.LoggingVisitor;
-import org.apache.geronimo.gshell.ExecutingVisitor;
-import org.apache.geronimo.gshell.CommandLine;
+import org.apache.geronimo.gshell.parser.ASTCommandLine;
+import org.apache.geronimo.gshell.parser.CommandLineParser;
+import org.apache.geronimo.gshell.parser.ParseException;
 import org.codehaus.plexus.PlexusContainer;
 import org.codehaus.plexus.component.repository.exception.ComponentLookupException;
 import org.slf4j.Logger;

Modified: geronimo/sandbox/gshell/trunk/gshell-core/src/main/java/org/apache/geronimo/gshell/CommandManagerImpl.java
URL: http://svn.apache.org/viewvc/geronimo/sandbox/gshell/trunk/gshell-core/src/main/java/org/apache/geronimo/gshell/CommandManagerImpl.java?rev=572187&r1=572186&r2=572187&view=diff
==============================================================================
--- geronimo/sandbox/gshell/trunk/gshell-core/src/main/java/org/apache/geronimo/gshell/CommandManagerImpl.java (original)
+++ geronimo/sandbox/gshell/trunk/gshell-core/src/main/java/org/apache/geronimo/gshell/CommandManagerImpl.java Sun Sep  2 16:19:30 2007
@@ -27,16 +27,16 @@
 import java.util.Properties;
 import java.util.Set;
 
+import org.apache.geronimo.gshell.command.Command;
+import org.apache.geronimo.gshell.command.CommandDefinition;
+import org.apache.geronimo.gshell.command.CommandManager;
+import org.apache.geronimo.gshell.command.CommandNotFoundException;
 import org.codehaus.plexus.PlexusContainer;
 import org.codehaus.plexus.component.repository.ComponentDescriptor;
 import org.codehaus.plexus.personality.plexus.lifecycle.phase.Initializable;
 import org.codehaus.plexus.personality.plexus.lifecycle.phase.InitializationException;
 import org.slf4j.Logger;
 import org.slf4j.LoggerFactory;
-import org.apache.geronimo.gshell.command.CommandManager;
-import org.apache.geronimo.gshell.command.CommandDefinition;
-import org.apache.geronimo.gshell.command.Command;
-import org.apache.geronimo.gshell.command.CommandNotFoundException;
 
 /**
  * Manager of command definitions and provides access to command instances.

Modified: geronimo/sandbox/gshell/trunk/gshell-core/src/main/java/org/apache/geronimo/gshell/ExecutingVisitor.java
URL: http://svn.apache.org/viewvc/geronimo/sandbox/gshell/trunk/gshell-core/src/main/java/org/apache/geronimo/gshell/ExecutingVisitor.java?rev=572187&r1=572186&r2=572187&view=diff
==============================================================================
--- geronimo/sandbox/gshell/trunk/gshell-core/src/main/java/org/apache/geronimo/gshell/ExecutingVisitor.java (original)
+++ geronimo/sandbox/gshell/trunk/gshell-core/src/main/java/org/apache/geronimo/gshell/ExecutingVisitor.java Sun Sep  2 16:19:30 2007
@@ -22,16 +22,14 @@
 import java.util.ArrayList;
 import java.util.List;
 
-import org.apache.geronimo.gshell.ErrorNotification;
-import org.apache.geronimo.gshell.Shell;
 import org.apache.geronimo.gshell.command.Variables;
-import org.apache.geronimo.gshell.commandline.parser.ASTCommandLine;
-import org.apache.geronimo.gshell.commandline.parser.ASTExpression;
-import org.apache.geronimo.gshell.commandline.parser.ASTOpaqueString;
-import org.apache.geronimo.gshell.commandline.parser.ASTPlainString;
-import org.apache.geronimo.gshell.commandline.parser.ASTQuotedString;
-import org.apache.geronimo.gshell.commandline.parser.CommandLineParserVisitor;
-import org.apache.geronimo.gshell.commandline.parser.SimpleNode;
+import org.apache.geronimo.gshell.parser.ASTCommandLine;
+import org.apache.geronimo.gshell.parser.ASTExpression;
+import org.apache.geronimo.gshell.parser.ASTOpaqueString;
+import org.apache.geronimo.gshell.parser.ASTPlainString;
+import org.apache.geronimo.gshell.parser.ASTQuotedString;
+import org.apache.geronimo.gshell.parser.CommandLineParserVisitor;
+import org.apache.geronimo.gshell.parser.SimpleNode;
 import org.apache.geronimo.gshell.util.Arguments;
 import org.codehaus.plexus.evaluator.EvaluatorException;
 import org.codehaus.plexus.evaluator.ExpressionEvaluator;

Modified: geronimo/sandbox/gshell/trunk/gshell-core/src/main/java/org/apache/geronimo/gshell/JLineConsole.java
URL: http://svn.apache.org/viewvc/geronimo/sandbox/gshell/trunk/gshell-core/src/main/java/org/apache/geronimo/gshell/JLineConsole.java?rev=572187&r1=572186&r2=572187&view=diff
==============================================================================
--- geronimo/sandbox/gshell/trunk/gshell-core/src/main/java/org/apache/geronimo/gshell/JLineConsole.java (original)
+++ geronimo/sandbox/gshell/trunk/gshell-core/src/main/java/org/apache/geronimo/gshell/JLineConsole.java Sun Sep  2 16:19:30 2007
@@ -25,7 +25,6 @@
 
 import jline.ConsoleReader;
 import jline.History;
-
 import org.apache.geronimo.gshell.console.Console;
 import org.apache.geronimo.gshell.console.IO;
 

Modified: geronimo/sandbox/gshell/trunk/gshell-core/src/main/java/org/apache/geronimo/gshell/LoggingVisitor.java
URL: http://svn.apache.org/viewvc/geronimo/sandbox/gshell/trunk/gshell-core/src/main/java/org/apache/geronimo/gshell/LoggingVisitor.java?rev=572187&r1=572186&r2=572187&view=diff
==============================================================================
--- geronimo/sandbox/gshell/trunk/gshell-core/src/main/java/org/apache/geronimo/gshell/LoggingVisitor.java (original)
+++ geronimo/sandbox/gshell/trunk/gshell-core/src/main/java/org/apache/geronimo/gshell/LoggingVisitor.java Sun Sep  2 16:19:30 2007
@@ -19,13 +19,13 @@
 
 package org.apache.geronimo.gshell;
 
-import org.apache.geronimo.gshell.commandline.parser.ASTCommandLine;
-import org.apache.geronimo.gshell.commandline.parser.ASTExpression;
-import org.apache.geronimo.gshell.commandline.parser.ASTOpaqueString;
-import org.apache.geronimo.gshell.commandline.parser.ASTPlainString;
-import org.apache.geronimo.gshell.commandline.parser.ASTQuotedString;
-import org.apache.geronimo.gshell.commandline.parser.CommandLineParserVisitor;
-import org.apache.geronimo.gshell.commandline.parser.SimpleNode;
+import org.apache.geronimo.gshell.parser.ASTCommandLine;
+import org.apache.geronimo.gshell.parser.ASTExpression;
+import org.apache.geronimo.gshell.parser.ASTOpaqueString;
+import org.apache.geronimo.gshell.parser.ASTPlainString;
+import org.apache.geronimo.gshell.parser.ASTQuotedString;
+import org.apache.geronimo.gshell.parser.CommandLineParserVisitor;
+import org.apache.geronimo.gshell.parser.SimpleNode;
 import org.slf4j.Logger;
 import org.slf4j.LoggerFactory;
 

Modified: geronimo/sandbox/gshell/trunk/gshell-core/src/main/java/org/apache/geronimo/gshell/Shell.java
URL: http://svn.apache.org/viewvc/geronimo/sandbox/gshell/trunk/gshell-core/src/main/java/org/apache/geronimo/gshell/Shell.java?rev=572187&r1=572186&r2=572187&view=diff
==============================================================================
--- geronimo/sandbox/gshell/trunk/gshell-core/src/main/java/org/apache/geronimo/gshell/Shell.java (original)
+++ geronimo/sandbox/gshell/trunk/gshell-core/src/main/java/org/apache/geronimo/gshell/Shell.java Sun Sep  2 16:19:30 2007
@@ -24,11 +24,7 @@
 import org.apache.geronimo.gshell.command.Command;
 import org.apache.geronimo.gshell.command.CommandContext;
 import org.apache.geronimo.gshell.command.CommandManager;
-import org.apache.geronimo.gshell.StandardVariables;
 import org.apache.geronimo.gshell.command.Variables;
-import org.apache.geronimo.gshell.VariablesImpl;
-import org.apache.geronimo.gshell.CommandLine;
-import org.apache.geronimo.gshell.CommandLineBuilder;
 import org.apache.geronimo.gshell.common.StopWatch;
 import org.apache.geronimo.gshell.console.IO;
 import org.apache.geronimo.gshell.util.Arguments;

Modified: geronimo/sandbox/gshell/trunk/gshell-core/src/test/java/org/apache/geronimo/gshell/CommandLineBuilderTest.java
URL: http://svn.apache.org/viewvc/geronimo/sandbox/gshell/trunk/gshell-core/src/test/java/org/apache/geronimo/gshell/CommandLineBuilderTest.java?rev=572187&r1=572186&r2=572187&view=diff
==============================================================================
--- geronimo/sandbox/gshell/trunk/gshell-core/src/test/java/org/apache/geronimo/gshell/CommandLineBuilderTest.java (original)
+++ geronimo/sandbox/gshell/trunk/gshell-core/src/test/java/org/apache/geronimo/gshell/CommandLineBuilderTest.java Sun Sep  2 16:19:30 2007
@@ -20,7 +20,6 @@
 package org.apache.geronimo.gshell;
 
 import junit.framework.TestCase;
-import org.apache.geronimo.gshell.CommandLineBuilder;
 
 /**
  * Unit tests for the {@link CommandLineBuilder} class.

Modified: geronimo/sandbox/gshell/trunk/gshell-core/src/test/java/org/apache/geronimo/gshell/CommandManagerImplTest.java
URL: http://svn.apache.org/viewvc/geronimo/sandbox/gshell/trunk/gshell-core/src/test/java/org/apache/geronimo/gshell/CommandManagerImplTest.java?rev=572187&r1=572186&r2=572187&view=diff
==============================================================================
--- geronimo/sandbox/gshell/trunk/gshell-core/src/test/java/org/apache/geronimo/gshell/CommandManagerImplTest.java (original)
+++ geronimo/sandbox/gshell/trunk/gshell-core/src/test/java/org/apache/geronimo/gshell/CommandManagerImplTest.java Sun Sep  2 16:19:30 2007
@@ -20,7 +20,6 @@
 package org.apache.geronimo.gshell;
 
 import junit.framework.TestCase;
-import org.apache.geronimo.gshell.CommandManagerImpl;
 import org.apache.geronimo.gshell.command.CommandManager;
 
 /**

Modified: geronimo/sandbox/gshell/trunk/gshell-core/src/test/java/org/apache/geronimo/gshell/ExecutingVisitorTest.java
URL: http://svn.apache.org/viewvc/geronimo/sandbox/gshell/trunk/gshell-core/src/test/java/org/apache/geronimo/gshell/ExecutingVisitorTest.java?rev=572187&r1=572186&r2=572187&view=diff
==============================================================================
--- geronimo/sandbox/gshell/trunk/gshell-core/src/test/java/org/apache/geronimo/gshell/ExecutingVisitorTest.java (original)
+++ geronimo/sandbox/gshell/trunk/gshell-core/src/test/java/org/apache/geronimo/gshell/ExecutingVisitorTest.java Sun Sep  2 16:19:30 2007
@@ -20,7 +20,6 @@
 package org.apache.geronimo.gshell;
 
 import junit.framework.TestCase;
-import org.apache.geronimo.gshell.ExecutingVisitor;
 
 /**
  * Unit tests for the {@link ExecutingVisitor} usage.

Modified: geronimo/sandbox/gshell/trunk/gshell-core/src/test/java/org/apache/geronimo/gshell/VariablesImplTest.java
URL: http://svn.apache.org/viewvc/geronimo/sandbox/gshell/trunk/gshell-core/src/test/java/org/apache/geronimo/gshell/VariablesImplTest.java?rev=572187&r1=572186&r2=572187&view=diff
==============================================================================
--- geronimo/sandbox/gshell/trunk/gshell-core/src/test/java/org/apache/geronimo/gshell/VariablesImplTest.java (original)
+++ geronimo/sandbox/gshell/trunk/gshell-core/src/test/java/org/apache/geronimo/gshell/VariablesImplTest.java Sun Sep  2 16:19:30 2007
@@ -24,7 +24,6 @@
 import java.util.Map;
 
 import junit.framework.TestCase;
-import org.apache.geronimo.gshell.VariablesImpl;
 import org.apache.geronimo.gshell.command.Variables;
 
 /**

Modified: geronimo/sandbox/gshell/trunk/gshell-parser/pom.xml
URL: http://svn.apache.org/viewvc/geronimo/sandbox/gshell/trunk/gshell-parser/pom.xml?rev=572187&r1=572186&r2=572187&view=diff
==============================================================================
--- geronimo/sandbox/gshell/trunk/gshell-parser/pom.xml (original)
+++ geronimo/sandbox/gshell/trunk/gshell-parser/pom.xml Sun Sep  2 16:19:30 2007
@@ -36,16 +36,36 @@
     <description>
         Provides the command-line syntax parsing muck.
     </description>
-    
+
     <dependencies>
         <dependency>
+            <groupId>org.slf4j</groupId>
+            <artifactId>slf4j-api</artifactId>
+        </dependency>
+
+        <dependency>
+            <groupId>junit</groupId>
+            <artifactId>junit</artifactId>
+            <scope>test</scope>
+        </dependency>
+
+        <dependency>
+            <groupId>org.slf4j</groupId>
+            <artifactId>slf4j-simple</artifactId>
+            <scope>test</scope>
+        </dependency>
+        
+        <!--
+        <dependency>
             <groupId>org.antlr</groupId>
             <artifactId>antlr-runtime</artifactId>
         </dependency>
+        -->
     </dependencies>
-
+    
     <build>
         <plugins>
+            <!--
             <plugin>
                 <groupId>org.codehaus.mojo</groupId>
                 <artifactId>antlr3-maven-plugin</artifactId>
@@ -54,6 +74,46 @@
                         <goals>
                             <goal>antlr</goal>
                         </goals>
+                    </execution>
+                </executions>
+            </plugin>
+            -->
+            
+            <plugin>
+                <groupId>org.apache.geronimo.gshell</groupId>
+                <artifactId>javacc-maven-plugin</artifactId>
+                <version>${pom.version}</version>
+                <executions>
+                    <execution>
+                        <id>jjtree</id>
+                        <phase>generate-sources</phase>
+                        <goals>
+                            <goal>jjtree</goal>
+                        </goals>
+                        <configuration>
+                            <grammars>
+                                <directory>${project.basedir}/src/main/grammar</directory>
+                                <includes>
+                                    <include>*.jjt</include>
+                                </includes>
+                            </grammars>
+                        </configuration>
+                    </execution>
+
+                    <execution>
+                        <id>javacc</id>
+                        <phase>generate-sources</phase>
+                        <goals>
+                            <goal>javacc</goal>
+                        </goals>
+                        <configuration>
+                            <grammars>
+                                <directory>${project.build.directory}/generated-sources/jjtree</directory>
+                                <includes>
+                                    <include>*.jj</include>
+                                </includes>
+                            </grammars>
+                        </configuration>
                     </execution>
                 </executions>
             </plugin>

Modified: geronimo/sandbox/gshell/trunk/gshell-parser/src/main/grammar/CommandLineParser.jjt
URL: http://svn.apache.org/viewvc/geronimo/sandbox/gshell/trunk/gshell-parser/src/main/grammar/CommandLineParser.jjt?rev=572187&r1=572186&r2=572187&view=diff
==============================================================================
--- geronimo/sandbox/gshell/trunk/gshell-parser/src/main/grammar/CommandLineParser.jjt (original)
+++ geronimo/sandbox/gshell/trunk/gshell-parser/src/main/grammar/CommandLineParser.jjt Sun Sep  2 16:19:30 2007
@@ -31,7 +31,7 @@
 
 PARSER_BEGIN(CommandLineParser)
 
-package org.apache.geronimo.gshell.commandline.parser;
+package org.apache.geronimo.gshell.parser;
 
 import java.io.Reader;
 import java.io.StringReader;
@@ -47,7 +47,7 @@
 public class CommandLineParser
     extends CommandLineParserSupport
 {
-    private static final Logger log = LoggerFactory.getLogger(CommandLineParser.class);
+    private final Logger log = LoggerFactory.getLogger(getClass());
 
     public CommandLineParser() {
         this(new StringReader(""));

Copied: geronimo/sandbox/gshell/trunk/gshell-parser/src/main/java/org/apache/geronimo/gshell/parser/ASTOpaqueString.java (from r572186, geronimo/sandbox/gshell/trunk/gshell-core/src/main/java/org/apache/geronimo/gshell/commandline/parser/ASTOpaqueString.java)
URL: http://svn.apache.org/viewvc/geronimo/sandbox/gshell/trunk/gshell-parser/src/main/java/org/apache/geronimo/gshell/parser/ASTOpaqueString.java?p2=geronimo/sandbox/gshell/trunk/gshell-parser/src/main/java/org/apache/geronimo/gshell/parser/ASTOpaqueString.java&p1=geronimo/sandbox/gshell/trunk/gshell-core/src/main/java/org/apache/geronimo/gshell/commandline/parser/ASTOpaqueString.java&r1=572186&r2=572187&rev=572187&view=diff
==============================================================================
--- geronimo/sandbox/gshell/trunk/gshell-core/src/main/java/org/apache/geronimo/gshell/commandline/parser/ASTOpaqueString.java (original)
+++ geronimo/sandbox/gshell/trunk/gshell-parser/src/main/java/org/apache/geronimo/gshell/parser/ASTOpaqueString.java Sun Sep  2 16:19:30 2007
@@ -17,7 +17,7 @@
  * under the License.
  */
 
-package org.apache.geronimo.gshell.commandline.parser;
+package org.apache.geronimo.gshell.parser;
 
 /**
  * Represents an <em>opaque</em> argument.

Propchange: geronimo/sandbox/gshell/trunk/gshell-parser/src/main/java/org/apache/geronimo/gshell/parser/ASTOpaqueString.java
------------------------------------------------------------------------------
    svn:eol-style = native

Propchange: geronimo/sandbox/gshell/trunk/gshell-parser/src/main/java/org/apache/geronimo/gshell/parser/ASTOpaqueString.java
------------------------------------------------------------------------------
    svn:keywords = Date Author Id Revision HeadURL

Propchange: geronimo/sandbox/gshell/trunk/gshell-parser/src/main/java/org/apache/geronimo/gshell/parser/ASTOpaqueString.java
------------------------------------------------------------------------------
    svn:mime-type = text/plain

Copied: geronimo/sandbox/gshell/trunk/gshell-parser/src/main/java/org/apache/geronimo/gshell/parser/ASTPlainString.java (from r572186, geronimo/sandbox/gshell/trunk/gshell-core/src/main/java/org/apache/geronimo/gshell/commandline/parser/ASTPlainString.java)
URL: http://svn.apache.org/viewvc/geronimo/sandbox/gshell/trunk/gshell-parser/src/main/java/org/apache/geronimo/gshell/parser/ASTPlainString.java?p2=geronimo/sandbox/gshell/trunk/gshell-parser/src/main/java/org/apache/geronimo/gshell/parser/ASTPlainString.java&p1=geronimo/sandbox/gshell/trunk/gshell-core/src/main/java/org/apache/geronimo/gshell/commandline/parser/ASTPlainString.java&r1=572186&r2=572187&rev=572187&view=diff
==============================================================================
--- geronimo/sandbox/gshell/trunk/gshell-core/src/main/java/org/apache/geronimo/gshell/commandline/parser/ASTPlainString.java (original)
+++ geronimo/sandbox/gshell/trunk/gshell-parser/src/main/java/org/apache/geronimo/gshell/parser/ASTPlainString.java Sun Sep  2 16:19:30 2007
@@ -17,7 +17,7 @@
  * under the License.
  */
 
-package org.apache.geronimo.gshell.commandline.parser;
+package org.apache.geronimo.gshell.parser;
 
 /**
  * Represents a <em>plain</em> unquoted argument.

Propchange: geronimo/sandbox/gshell/trunk/gshell-parser/src/main/java/org/apache/geronimo/gshell/parser/ASTPlainString.java
------------------------------------------------------------------------------
    svn:eol-style = native

Propchange: geronimo/sandbox/gshell/trunk/gshell-parser/src/main/java/org/apache/geronimo/gshell/parser/ASTPlainString.java
------------------------------------------------------------------------------
    svn:keywords = Date Author Id Revision HeadURL

Propchange: geronimo/sandbox/gshell/trunk/gshell-parser/src/main/java/org/apache/geronimo/gshell/parser/ASTPlainString.java
------------------------------------------------------------------------------
    svn:mime-type = text/plain

Copied: geronimo/sandbox/gshell/trunk/gshell-parser/src/main/java/org/apache/geronimo/gshell/parser/ASTQuotedString.java (from r572186, geronimo/sandbox/gshell/trunk/gshell-core/src/main/java/org/apache/geronimo/gshell/commandline/parser/ASTQuotedString.java)
URL: http://svn.apache.org/viewvc/geronimo/sandbox/gshell/trunk/gshell-parser/src/main/java/org/apache/geronimo/gshell/parser/ASTQuotedString.java?p2=geronimo/sandbox/gshell/trunk/gshell-parser/src/main/java/org/apache/geronimo/gshell/parser/ASTQuotedString.java&p1=geronimo/sandbox/gshell/trunk/gshell-core/src/main/java/org/apache/geronimo/gshell/commandline/parser/ASTQuotedString.java&r1=572186&r2=572187&rev=572187&view=diff
==============================================================================
--- geronimo/sandbox/gshell/trunk/gshell-core/src/main/java/org/apache/geronimo/gshell/commandline/parser/ASTQuotedString.java (original)
+++ geronimo/sandbox/gshell/trunk/gshell-parser/src/main/java/org/apache/geronimo/gshell/parser/ASTQuotedString.java Sun Sep  2 16:19:30 2007
@@ -17,7 +17,7 @@
  * under the License.
  */
 
-package org.apache.geronimo.gshell.commandline.parser;
+package org.apache.geronimo.gshell.parser;
 
 /**
  * Represents a quoted (with double quotes) argument.

Propchange: geronimo/sandbox/gshell/trunk/gshell-parser/src/main/java/org/apache/geronimo/gshell/parser/ASTQuotedString.java
------------------------------------------------------------------------------
    svn:eol-style = native

Propchange: geronimo/sandbox/gshell/trunk/gshell-parser/src/main/java/org/apache/geronimo/gshell/parser/ASTQuotedString.java
------------------------------------------------------------------------------
    svn:keywords = Date Author Id Revision HeadURL

Propchange: geronimo/sandbox/gshell/trunk/gshell-parser/src/main/java/org/apache/geronimo/gshell/parser/ASTQuotedString.java
------------------------------------------------------------------------------
    svn:mime-type = text/plain

Copied: geronimo/sandbox/gshell/trunk/gshell-parser/src/main/java/org/apache/geronimo/gshell/parser/CommandLineParserSupport.java (from r572186, geronimo/sandbox/gshell/trunk/gshell-core/src/main/java/org/apache/geronimo/gshell/commandline/parser/CommandLineParserSupport.java)
URL: http://svn.apache.org/viewvc/geronimo/sandbox/gshell/trunk/gshell-parser/src/main/java/org/apache/geronimo/gshell/parser/CommandLineParserSupport.java?p2=geronimo/sandbox/gshell/trunk/gshell-parser/src/main/java/org/apache/geronimo/gshell/parser/CommandLineParserSupport.java&p1=geronimo/sandbox/gshell/trunk/gshell-core/src/main/java/org/apache/geronimo/gshell/commandline/parser/CommandLineParserSupport.java&r1=572186&r2=572187&rev=572187&view=diff
==============================================================================
--- geronimo/sandbox/gshell/trunk/gshell-core/src/main/java/org/apache/geronimo/gshell/commandline/parser/CommandLineParserSupport.java (original)
+++ geronimo/sandbox/gshell/trunk/gshell-parser/src/main/java/org/apache/geronimo/gshell/parser/CommandLineParserSupport.java Sun Sep  2 16:19:30 2007
@@ -17,7 +17,7 @@
  * under the License.
  */
 
-package org.apache.geronimo.gshell.commandline.parser;
+package org.apache.geronimo.gshell.parser;
 
 /**
  * Support for {@link CommandLineParser}.

Propchange: geronimo/sandbox/gshell/trunk/gshell-parser/src/main/java/org/apache/geronimo/gshell/parser/CommandLineParserSupport.java
------------------------------------------------------------------------------
    svn:eol-style = native

Propchange: geronimo/sandbox/gshell/trunk/gshell-parser/src/main/java/org/apache/geronimo/gshell/parser/CommandLineParserSupport.java
------------------------------------------------------------------------------
    svn:keywords = Date Author Id Revision HeadURL

Propchange: geronimo/sandbox/gshell/trunk/gshell-parser/src/main/java/org/apache/geronimo/gshell/parser/CommandLineParserSupport.java
------------------------------------------------------------------------------
    svn:mime-type = text/plain

Copied: geronimo/sandbox/gshell/trunk/gshell-parser/src/main/java/org/apache/geronimo/gshell/parser/NodeSupport.java (from r572186, geronimo/sandbox/gshell/trunk/gshell-core/src/main/java/org/apache/geronimo/gshell/commandline/parser/NodeSupport.java)
URL: http://svn.apache.org/viewvc/geronimo/sandbox/gshell/trunk/gshell-parser/src/main/java/org/apache/geronimo/gshell/parser/NodeSupport.java?p2=geronimo/sandbox/gshell/trunk/gshell-parser/src/main/java/org/apache/geronimo/gshell/parser/NodeSupport.java&p1=geronimo/sandbox/gshell/trunk/gshell-core/src/main/java/org/apache/geronimo/gshell/commandline/parser/NodeSupport.java&r1=572186&r2=572187&rev=572187&view=diff
==============================================================================
--- geronimo/sandbox/gshell/trunk/gshell-core/src/main/java/org/apache/geronimo/gshell/commandline/parser/NodeSupport.java (original)
+++ geronimo/sandbox/gshell/trunk/gshell-parser/src/main/java/org/apache/geronimo/gshell/parser/NodeSupport.java Sun Sep  2 16:19:30 2007
@@ -17,7 +17,7 @@
  * under the License.
  */
 
-package org.apache.geronimo.gshell.commandline.parser;
+package org.apache.geronimo.gshell.parser;
 
 /**
  * Support for nodes.

Propchange: geronimo/sandbox/gshell/trunk/gshell-parser/src/main/java/org/apache/geronimo/gshell/parser/NodeSupport.java
------------------------------------------------------------------------------
    svn:eol-style = native

Propchange: geronimo/sandbox/gshell/trunk/gshell-parser/src/main/java/org/apache/geronimo/gshell/parser/NodeSupport.java
------------------------------------------------------------------------------
    svn:keywords = Date Author Id Revision HeadURL

Propchange: geronimo/sandbox/gshell/trunk/gshell-parser/src/main/java/org/apache/geronimo/gshell/parser/NodeSupport.java
------------------------------------------------------------------------------
    svn:mime-type = text/plain

Copied: geronimo/sandbox/gshell/trunk/gshell-parser/src/main/java/org/apache/geronimo/gshell/parser/StringSupport.java (from r572186, geronimo/sandbox/gshell/trunk/gshell-core/src/main/java/org/apache/geronimo/gshell/commandline/parser/StringSupport.java)
URL: http://svn.apache.org/viewvc/geronimo/sandbox/gshell/trunk/gshell-parser/src/main/java/org/apache/geronimo/gshell/parser/StringSupport.java?p2=geronimo/sandbox/gshell/trunk/gshell-parser/src/main/java/org/apache/geronimo/gshell/parser/StringSupport.java&p1=geronimo/sandbox/gshell/trunk/gshell-core/src/main/java/org/apache/geronimo/gshell/commandline/parser/StringSupport.java&r1=572186&r2=572187&rev=572187&view=diff
==============================================================================
--- geronimo/sandbox/gshell/trunk/gshell-core/src/main/java/org/apache/geronimo/gshell/commandline/parser/StringSupport.java (original)
+++ geronimo/sandbox/gshell/trunk/gshell-parser/src/main/java/org/apache/geronimo/gshell/parser/StringSupport.java Sun Sep  2 16:19:30 2007
@@ -17,7 +17,7 @@
  * under the License.
  */
 
-package org.apache.geronimo.gshell.commandline.parser;
+package org.apache.geronimo.gshell.parser;
 
 /**
  * Support for string types.

Propchange: geronimo/sandbox/gshell/trunk/gshell-parser/src/main/java/org/apache/geronimo/gshell/parser/StringSupport.java
------------------------------------------------------------------------------
    svn:eol-style = native

Propchange: geronimo/sandbox/gshell/trunk/gshell-parser/src/main/java/org/apache/geronimo/gshell/parser/StringSupport.java
------------------------------------------------------------------------------
    svn:keywords = Date Author Id Revision HeadURL

Propchange: geronimo/sandbox/gshell/trunk/gshell-parser/src/main/java/org/apache/geronimo/gshell/parser/StringSupport.java
------------------------------------------------------------------------------
    svn:mime-type = text/plain

Added: geronimo/sandbox/gshell/trunk/gshell-parser/src/main/java/org/apache/geronimo/gshell/parser/package-info.java
URL: http://svn.apache.org/viewvc/geronimo/sandbox/gshell/trunk/gshell-parser/src/main/java/org/apache/geronimo/gshell/parser/package-info.java?rev=572187&view=auto
==============================================================================
--- geronimo/sandbox/gshell/trunk/gshell-parser/src/main/java/org/apache/geronimo/gshell/parser/package-info.java (added)
+++ geronimo/sandbox/gshell/trunk/gshell-parser/src/main/java/org/apache/geronimo/gshell/parser/package-info.java Sun Sep  2 16:19:30 2007
@@ -0,0 +1,25 @@
+/*
+ * Licensed to the Apache Software Foundation (ASF) under one
+ * or more contributor license agreements.  See the NOTICE file
+ * distributed with this work for additional information
+ * regarding copyright ownership.  The ASF licenses this file
+ * to you under the Apache License, Version 2.0 (the
+ * "License"); you may not use this file except in compliance
+ * with the License.  You may obtain a copy of the License at
+ *
+ *  http://www.apache.org/licenses/LICENSE-2.0
+ *
+ * Unless required by applicable law or agreed to in writing,
+ * software distributed under the License is distributed on an
+ * "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
+ * KIND, either express or implied.  See the License for the
+ * specific language governing permissions and limitations
+ * under the License.
+ */
+
+/**
+ * Provides the parsing for command-lines.
+ *
+ * @version $Rev$ $Date$
+ */
+package org.apache.geronimo.gshell.commandline.parser;
\ No newline at end of file

Propchange: geronimo/sandbox/gshell/trunk/gshell-parser/src/main/java/org/apache/geronimo/gshell/parser/package-info.java
------------------------------------------------------------------------------
    svn:eol-style = native

Propchange: geronimo/sandbox/gshell/trunk/gshell-parser/src/main/java/org/apache/geronimo/gshell/parser/package-info.java
------------------------------------------------------------------------------
    svn:keywords = Date Author Id Revision HeadURL

Propchange: geronimo/sandbox/gshell/trunk/gshell-parser/src/main/java/org/apache/geronimo/gshell/parser/package-info.java
------------------------------------------------------------------------------
    svn:mime-type = text/plain

Modified: geronimo/sandbox/gshell/trunk/gshell-parser/src/test/java/org/apache/geronimo/gshell/parser/CommandLineParserTest.java
URL: http://svn.apache.org/viewvc/geronimo/sandbox/gshell/trunk/gshell-parser/src/test/java/org/apache/geronimo/gshell/parser/CommandLineParserTest.java?rev=572187&r1=572186&r2=572187&view=diff
==============================================================================
--- geronimo/sandbox/gshell/trunk/gshell-parser/src/test/java/org/apache/geronimo/gshell/parser/CommandLineParserTest.java (original)
+++ geronimo/sandbox/gshell/trunk/gshell-parser/src/test/java/org/apache/geronimo/gshell/parser/CommandLineParserTest.java Sun Sep  2 16:19:30 2007
@@ -19,44 +19,286 @@
 
 package org.apache.geronimo.gshell.parser;
 
+import java.io.Reader;
+import java.io.StringReader;
+
 import junit.framework.TestCase;
-import org.antlr.runtime.ANTLRStringStream;
-import org.antlr.runtime.CharStream;
-import org.antlr.runtime.CommonTokenStream;
-import org.antlr.runtime.tree.CommonTreeNodeStream;
-import org.antlr.runtime.tree.Tree;
 
 /**
- * Tests for the {@link CommandLineParser} class.
+ * Unit tests for the {@link CommandLineParser} class.
  *
  * @version $Rev$ $Date$
  */
 public class CommandLineParserTest
     extends TestCase
 {
-    public void test1() throws Exception {
-        String input = "a b 'c'; d";
-        CharStream stream = new ANTLRStringStream(input);
-
-        CommandLineLexer lex = new CommandLineLexer(stream);
-        CommonTokenStream ts = new CommonTokenStream(lex);
-
-        /*
-        CommonTreeNodeStream nodes = new CommonTreeNodeStream((Tree)r.tree);
-		nodes.setTokenStream(tokens);
-		SimpleCWalker walker = new SimpleCWalker(nodes);
-		walker.program();
-        */
-        
-        CommandLineParser parser = new CommandLineParser(ts);
-        CommandLineParser.compilationUnit_return r = parser.compilationUnit();
-        System.out.println("tree="+((Tree)r.tree).toStringTree());
-
-        /*
-        CommonTreeNodeStream nodes = new CommonTreeNodeStream((Tree)r.tree);
-		nodes.setTokenStream(ts);
-		CommandLineWalker walker = new CommandLineWalker(nodes);
-		walker.commandLine();
-		*/
+    private ASTCommandLine parse(final String input) throws ParseException {
+        assert input != null;
+
+        Reader reader = new StringReader(input);
+        CommandLineParser parser = new CommandLineParser();
+        ASTCommandLine cl = parser.parse(reader);
+
+        assertNotNull(cl);
+
+        return cl;
+    }
+
+    //
+    // Comments
+    //
+
+    public void testSingleComment1() throws Exception {
+        String input = "# this should be completly ignored";
+
+        ASTCommandLine cl = parse(input);
+
+        assertEquals(0, cl.jjtGetNumChildren());
+    }
+
+    public void testSingleComment2() throws Exception {
+        String input = "####";
+
+        ASTCommandLine cl = parse(input);
+
+        assertEquals(0, cl.jjtGetNumChildren());
+    }
+
+    public void testSingleComment3() throws Exception {
+        String input = "# ignored; this too";
+
+        ASTCommandLine cl = parse(input);
+
+        assertEquals(0, cl.jjtGetNumChildren());
+    }
+
+    //
+    // Strings
+    //
+
+    public void testStrings1() throws Exception {
+        String input = "a b c";
+
+        ASTCommandLine cl = parse(input);
+
+        // One expression
+        assertEquals(1, cl.jjtGetNumChildren());
+
+        // 3 plain strings
+        Node child = cl.jjtGetChild(0);
+        assertEquals(3, child.jjtGetNumChildren());
+
+        for (int i=0; i<3; i++ ) {
+            Node node = child.jjtGetChild(i);
+            assertEquals(ASTPlainString.class, node.getClass());
+        }
+
+        assertEquals("a", ((ASTPlainString)child.jjtGetChild(0)).getValue());
+        assertEquals("b", ((ASTPlainString)child.jjtGetChild(1)).getValue());
+        assertEquals("c", ((ASTPlainString)child.jjtGetChild(2)).getValue());
+    }
+
+    public void testStrings2() throws Exception {
+        String input = "a -b --c d";
+
+        ASTCommandLine cl = parse(input);
+
+        // One expression
+        assertEquals(1, cl.jjtGetNumChildren());
+
+        // 4 plain strings
+        Node child = cl.jjtGetChild(0);
+        assertEquals(4, child.jjtGetNumChildren());
+
+        for (int i=0; i<4; i++ ) {
+            Node node = child.jjtGetChild(i);
+            assertEquals(ASTPlainString.class, node.getClass());
+        }
+
+        assertEquals("a", ((ASTPlainString)child.jjtGetChild(0)).getValue());
+        assertEquals("-b", ((ASTPlainString)child.jjtGetChild(1)).getValue());
+        assertEquals("--c", ((ASTPlainString)child.jjtGetChild(2)).getValue());
+        assertEquals("d", ((ASTPlainString)child.jjtGetChild(3)).getValue());
+    }
+
+    public void testQuotedStrings1() throws Exception {
+        String input = "a \"b -c\" d";
+
+        ASTCommandLine cl = parse(input);
+
+        // One expression
+        assertEquals(1, cl.jjtGetNumChildren());
+
+        Node child = cl.jjtGetChild(0);
+        assertEquals(3, child.jjtGetNumChildren());
+
+        // Verify 2 plain strings + 1 quoted
+        Node node;
+
+        node = child.jjtGetChild(0);
+        assertEquals(ASTPlainString.class, node.getClass());
+        assertEquals("a", ((StringSupport)node).getValue());
+
+        node = child.jjtGetChild(1);
+        assertEquals(ASTQuotedString.class, node.getClass());
+        assertEquals("b -c", ((StringSupport)node).getValue());
+        assertEquals("\"b -c\"", ((StringSupport)node).getToken().image);
+
+        node = child.jjtGetChild(2);
+        assertEquals(ASTPlainString.class, node.getClass());
+        assertEquals("d", ((StringSupport)node).getValue());
+    }
+
+    public void testOpaqueStrings1() throws Exception {
+        String input = "a 'b -c' d";
+
+        ASTCommandLine cl = parse(input);
+
+        // One expression
+        assertEquals(1, cl.jjtGetNumChildren());
+
+        Node child = cl.jjtGetChild(0);
+        assertEquals(3, child.jjtGetNumChildren());
+
+        // Verify 2 plain strings + 1 opaque
+        Node node;
+
+        node = child.jjtGetChild(0);
+        assertEquals(ASTPlainString.class, node.getClass());
+        assertEquals("a", ((StringSupport)node).getValue());
+
+        node = child.jjtGetChild(1);
+        assertEquals(ASTOpaqueString.class, node.getClass());
+        assertEquals("b -c", ((StringSupport)node).getValue());
+        assertEquals("'b -c'", ((StringSupport)node).getToken().image);
+
+        node = child.jjtGetChild(2);
+        assertEquals(ASTPlainString.class, node.getClass());
+    }
+
+    public void testMoreStrings1() throws Exception {
+        String input = "a 'b -c' \"d\" e";
+
+        ASTCommandLine cl = parse(input);
+
+        // One expression
+        assertEquals(1, cl.jjtGetNumChildren());
+
+        Node child = cl.jjtGetChild(0);
+        assertEquals(4, child.jjtGetNumChildren());
+
+        Node node;
+
+        node = child.jjtGetChild(0);
+        assertEquals(ASTPlainString.class, node.getClass());
+        assertEquals("a", ((StringSupport)node).getValue());
+
+        node = child.jjtGetChild(1);
+        assertEquals(ASTOpaqueString.class, node.getClass());
+        assertEquals("b -c", ((StringSupport)node).getValue());
+        assertEquals("'b -c'", ((StringSupport)node).getToken().image);
+
+        node = child.jjtGetChild(2);
+        assertEquals(ASTQuotedString.class, node.getClass());
+        assertEquals("d", ((StringSupport)node).getValue());
+        assertEquals("\"d\"", ((StringSupport)node).getToken().image);
+
+        node = child.jjtGetChild(3);
+        assertEquals(ASTPlainString.class, node.getClass());
+    }
+
+    public void testMoreStrings2() throws Exception {
+        String input = "a \"b -c\" 'd' e";
+
+        ASTCommandLine cl = parse(input);
+
+        // One expression
+        assertEquals(1, cl.jjtGetNumChildren());
+
+        Node child = cl.jjtGetChild(0);
+        assertEquals(4, child.jjtGetNumChildren());
+
+        Node node;
+
+        node = child.jjtGetChild(0);
+        assertEquals(ASTPlainString.class, node.getClass());
+        assertEquals("a", ((StringSupport)node).getValue());
+
+        node = child.jjtGetChild(1);
+        assertEquals(ASTQuotedString.class, node.getClass());
+        assertEquals("b -c", ((StringSupport)node).getValue());
+        assertEquals("\"b -c\"", ((StringSupport)node).getToken().image);
+
+        node = child.jjtGetChild(2);
+        assertEquals(ASTOpaqueString.class, node.getClass());
+        assertEquals("d", ((StringSupport)node).getValue());
+        assertEquals("'d'", ((StringSupport)node).getToken().image);
+
+        node = child.jjtGetChild(3);
+        assertEquals(ASTPlainString.class, node.getClass());
+    }
+
+    //
+    // Compound
+    //
+
+    public void testCompoundCommandLine1() throws Exception {
+        String input = "a b c; d e f";
+
+        ASTCommandLine cl = parse(input);
+
+        assertEquals(2, cl.jjtGetNumChildren());
+
+        //
+        // TODO: Verify 2 expressions
+        //
+    }
+
+    public void testCompoundCommandLine2() throws Exception {
+        String input = "a b c;";
+
+        ASTCommandLine cl = parse(input);
+
+        assertEquals(1, cl.jjtGetNumChildren());
+
+        //
+        // TODO: Verify ...
+        //
+    }
+
+    public void testCompoundCommandLine3() throws Exception {
+        String input = "a b c;;;;";
+
+        ASTCommandLine cl = parse(input);
+
+        assertEquals(1, cl.jjtGetNumChildren());
+
+        //
+        // TODO: Verify ...
+        //
+    }
+
+    public void testCompoundCommandLine4() throws Exception {
+        String input = "a b c;;;;d e f";
+
+        ASTCommandLine cl = parse(input);
+
+        assertEquals(2, cl.jjtGetNumChildren());
+
+        //
+        // TODO: Verify ...
+        //
+    }
+
+    public void testNotCompoundCommandLine1() throws Exception {
+        String input = "a b c\\; d e f";
+
+        ASTCommandLine cl = parse(input);
+
+        assertEquals(1, cl.jjtGetNumChildren());
+
+        //
+        // TODO: Verify 1 expression
+        //
     }
-}
\ No newline at end of file
+}

Copied: geronimo/sandbox/gshell/trunk/gshell-parser/src/test/java/org/apache/geronimo/gshell/parser/CommandLineParserVisitorTest.java (from r572186, geronimo/sandbox/gshell/trunk/gshell-core/src/test/java/org/apache/geronimo/gshell/commandline/parser/CommandLineParserVisitorTest.java)
URL: http://svn.apache.org/viewvc/geronimo/sandbox/gshell/trunk/gshell-parser/src/test/java/org/apache/geronimo/gshell/parser/CommandLineParserVisitorTest.java?p2=geronimo/sandbox/gshell/trunk/gshell-parser/src/test/java/org/apache/geronimo/gshell/parser/CommandLineParserVisitorTest.java&p1=geronimo/sandbox/gshell/trunk/gshell-core/src/test/java/org/apache/geronimo/gshell/commandline/parser/CommandLineParserVisitorTest.java&r1=572186&r2=572187&rev=572187&view=diff
==============================================================================
--- geronimo/sandbox/gshell/trunk/gshell-core/src/test/java/org/apache/geronimo/gshell/commandline/parser/CommandLineParserVisitorTest.java (original)
+++ geronimo/sandbox/gshell/trunk/gshell-parser/src/test/java/org/apache/geronimo/gshell/parser/CommandLineParserVisitorTest.java Sun Sep  2 16:19:30 2007
@@ -17,7 +17,7 @@
  * under the License.
  */
 
-package org.apache.geronimo.gshell.commandline.parser;
+package org.apache.geronimo.gshell.parser;
 
 import java.io.Reader;
 import java.io.StringReader;

Propchange: geronimo/sandbox/gshell/trunk/gshell-parser/src/test/java/org/apache/geronimo/gshell/parser/CommandLineParserVisitorTest.java
------------------------------------------------------------------------------
    svn:eol-style = native

Propchange: geronimo/sandbox/gshell/trunk/gshell-parser/src/test/java/org/apache/geronimo/gshell/parser/CommandLineParserVisitorTest.java
------------------------------------------------------------------------------
    svn:keywords = Date Author Id Revision HeadURL

Propchange: geronimo/sandbox/gshell/trunk/gshell-parser/src/test/java/org/apache/geronimo/gshell/parser/CommandLineParserVisitorTest.java
------------------------------------------------------------------------------
    svn:mime-type = text/plain

Modified: geronimo/sandbox/gshell/trunk/pom.xml
URL: http://svn.apache.org/viewvc/geronimo/sandbox/gshell/trunk/pom.xml?rev=572187&r1=572186&r2=572187&view=diff
==============================================================================
--- geronimo/sandbox/gshell/trunk/pom.xml (original)
+++ geronimo/sandbox/gshell/trunk/pom.xml Sun Sep  2 16:19:30 2007
@@ -311,9 +311,9 @@
         <module>gshell-prefs</module>
         <module>gshell-ansi</module>
         <module>gshell-bootstrap</module>
-        <module>javacc-maven-plugin</module>
         <module>gshell-console</module>
         <module>gshell-api</module>
+        <module>javacc-maven-plugin</module>
         <module>gshell-parser</module>
         <module>gshell-layout</module>
         <module>gshell-core</module>



Mime
View raw message