Return-Path: Delivered-To: apmail-geronimo-scm-archive@www.apache.org Received: (qmail 46680 invoked from network); 25 May 2006 06:02:18 -0000 Received: from hermes.apache.org (HELO mail.apache.org) (209.237.227.199) by minotaur.apache.org with SMTP; 25 May 2006 06:02:18 -0000 Received: (qmail 27888 invoked by uid 500); 25 May 2006 06:02:18 -0000 Delivered-To: apmail-geronimo-scm-archive@geronimo.apache.org Received: (qmail 27860 invoked by uid 500); 25 May 2006 06:02:18 -0000 Mailing-List: contact scm-help@geronimo.apache.org; run by ezmlm Precedence: bulk list-help: list-unsubscribe: List-Post: Reply-To: dev@geronimo.apache.org List-Id: Delivered-To: mailing list scm@geronimo.apache.org Received: (qmail 27849 invoked by uid 99); 25 May 2006 06:02:18 -0000 Received: from asf.osuosl.org (HELO asf.osuosl.org) (140.211.166.49) by apache.org (qpsmtpd/0.29) with ESMTP; Wed, 24 May 2006 23:02:18 -0700 X-ASF-Spam-Status: No, hits=0.6 required=10.0 tests=NO_REAL_NAME X-Spam-Check-By: apache.org Received-SPF: pass (asf.osuosl.org: local policy) Received: from [140.211.166.113] (HELO eris.apache.org) (140.211.166.113) by apache.org (qpsmtpd/0.29) with ESMTP; Wed, 24 May 2006 23:02:17 -0700 Received: by eris.apache.org (Postfix, from userid 65534) id 1CC671A983A; Wed, 24 May 2006 23:01:57 -0700 (PDT) Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit Subject: svn commit: r409309 - in /geronimo/sandbox/gshell/trunk/gshell-core: ./ src/main/grammar/ src/main/java/org/apache/geronimo/gshell/commandline/ src/main/java/org/apache/geronimo/gshell/commandline/parser/ src/test/java/org/apache/geronimo/gshell/comman... Date: Thu, 25 May 2006 06:01:56 -0000 To: scm@geronimo.apache.org From: jdillon@apache.org X-Mailer: svnmailer-1.0.8 Message-Id: <20060525060157.1CC671A983A@eris.apache.org> X-Virus-Checked: Checked by ClamAV on apache.org X-Spam-Rating: minotaur.apache.org 1.6.2 0/1000/N Author: jdillon Date: Wed May 24 23:01:55 2006 New Revision: 409309 URL: http://svn.apache.org/viewvc?rev=409309&view=rev Log: Opaque (single quoted) arguments Added: geronimo/sandbox/gshell/trunk/gshell-core/src/main/java/org/apache/geronimo/gshell/commandline/CommandLine.java geronimo/sandbox/gshell/trunk/gshell-core/src/main/java/org/apache/geronimo/gshell/commandline/CommandLineBuilder.java geronimo/sandbox/gshell/trunk/gshell-core/src/main/java/org/apache/geronimo/gshell/commandline/parser/ASTOpaqueArgument.java Modified: geronimo/sandbox/gshell/trunk/gshell-core/pom.xml geronimo/sandbox/gshell/trunk/gshell-core/src/main/grammar/CommandLineParser.jjt geronimo/sandbox/gshell/trunk/gshell-core/src/test/java/org/apache/geronimo/gshell/commandline/parser/CommandLineParserTest.java Modified: geronimo/sandbox/gshell/trunk/gshell-core/pom.xml URL: http://svn.apache.org/viewvc/geronimo/sandbox/gshell/trunk/gshell-core/pom.xml?rev=409309&r1=409308&r2=409309&view=diff ============================================================================== --- geronimo/sandbox/gshell/trunk/gshell-core/pom.xml (original) +++ geronimo/sandbox/gshell/trunk/gshell-core/pom.xml Wed May 24 23:01:55 2006 @@ -105,6 +105,7 @@ + Modified: geronimo/sandbox/gshell/trunk/gshell-core/src/main/grammar/CommandLineParser.jjt URL: http://svn.apache.org/viewvc/geronimo/sandbox/gshell/trunk/gshell-core/src/main/grammar/CommandLineParser.jjt?rev=409309&r1=409308&r2=409309&view=diff ============================================================================== --- geronimo/sandbox/gshell/trunk/gshell-core/src/main/grammar/CommandLineParser.jjt (original) +++ geronimo/sandbox/gshell/trunk/gshell-core/src/main/grammar/CommandLineParser.jjt Wed May 24 23:01:55 2006 @@ -86,6 +86,19 @@ )+ > | + < OPAQUE_ARGUMENT: + "'" + ( (~["\"","\\","\n","\r"]) + | ("\\" + ( ["n","t","b","r","f","\\","'","\""] + | ["0"-"7"] ( ["0"-"7"] )? + | ["0"-"3"] ["0"-"7"] ["0"-"7"] + ) + ) + )* + "'" + > +| < QUOTED_ARGUMENT: "\"" ( (~["\"","\\","\n","\r"]) @@ -115,7 +128,7 @@ void Argument() : {} { - QuotedArgument() | PlainArgument() + QuotedArgument() | OpaqueArgument() | PlainArgument() } void QuotedArgument() #QuotedArgument: @@ -124,6 +137,17 @@ } { t= + { + jjtThis.setToken(t); + } +} + +void OpaqueArgument() #OpaqueArgument: +{ + Token t; +} +{ + t= { jjtThis.setToken(t); } Added: geronimo/sandbox/gshell/trunk/gshell-core/src/main/java/org/apache/geronimo/gshell/commandline/CommandLine.java URL: http://svn.apache.org/viewvc/geronimo/sandbox/gshell/trunk/gshell-core/src/main/java/org/apache/geronimo/gshell/commandline/CommandLine.java?rev=409309&view=auto ============================================================================== --- geronimo/sandbox/gshell/trunk/gshell-core/src/main/java/org/apache/geronimo/gshell/commandline/CommandLine.java (added) +++ geronimo/sandbox/gshell/trunk/gshell-core/src/main/java/org/apache/geronimo/gshell/commandline/CommandLine.java Wed May 24 23:01:55 2006 @@ -0,0 +1,29 @@ +/* + * Copyright 2006 The Apache Software Foundation + * + * Licensed 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. + */ + +package org.apache.geronimo.gshell.commandline; + +/** + * ??? + * + * @version $Id: Variables.java 404908 2006-05-08 03:42:51Z jdillon $ + */ +public class CommandLine +{ + // + // void execute() throws Exception; + // +} Added: geronimo/sandbox/gshell/trunk/gshell-core/src/main/java/org/apache/geronimo/gshell/commandline/CommandLineBuilder.java URL: http://svn.apache.org/viewvc/geronimo/sandbox/gshell/trunk/gshell-core/src/main/java/org/apache/geronimo/gshell/commandline/CommandLineBuilder.java?rev=409309&view=auto ============================================================================== --- geronimo/sandbox/gshell/trunk/gshell-core/src/main/java/org/apache/geronimo/gshell/commandline/CommandLineBuilder.java (added) +++ geronimo/sandbox/gshell/trunk/gshell-core/src/main/java/org/apache/geronimo/gshell/commandline/CommandLineBuilder.java Wed May 24 23:01:55 2006 @@ -0,0 +1,26 @@ +/* + * Copyright 2006 The Apache Software Foundation + * + * Licensed 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. + */ + +package org.apache.geronimo.gshell.commandline; + +/** + * ??? + * + * @version $Id: Variables.java 404908 2006-05-08 03:42:51Z jdillon $ + */ +public class CommandLineBuilder +{ +} Added: geronimo/sandbox/gshell/trunk/gshell-core/src/main/java/org/apache/geronimo/gshell/commandline/parser/ASTOpaqueArgument.java URL: http://svn.apache.org/viewvc/geronimo/sandbox/gshell/trunk/gshell-core/src/main/java/org/apache/geronimo/gshell/commandline/parser/ASTOpaqueArgument.java?rev=409309&view=auto ============================================================================== --- geronimo/sandbox/gshell/trunk/gshell-core/src/main/java/org/apache/geronimo/gshell/commandline/parser/ASTOpaqueArgument.java (added) +++ geronimo/sandbox/gshell/trunk/gshell-core/src/main/java/org/apache/geronimo/gshell/commandline/parser/ASTOpaqueArgument.java Wed May 24 23:01:55 2006 @@ -0,0 +1,34 @@ +/* + * Copyright 2006 The Apache Software Foundation + * + * Licensed 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. + */ + +package org.apache.geronimo.gshell.commandline.parser; + +/** + * Represents a plain unquoted argument. + * + * @version $Id$ + */ +public class ASTOpaqueArgument + extends ASTArgumentSupport +{ + public ASTOpaqueArgument(int id) { + super(id); + } + + public ASTOpaqueArgument(CommandLineParser p, int id) { + super(p, id); + } +} \ No newline at end of file Modified: geronimo/sandbox/gshell/trunk/gshell-core/src/test/java/org/apache/geronimo/gshell/commandline/parser/CommandLineParserTest.java URL: http://svn.apache.org/viewvc/geronimo/sandbox/gshell/trunk/gshell-core/src/test/java/org/apache/geronimo/gshell/commandline/parser/CommandLineParserTest.java?rev=409309&r1=409308&r2=409309&view=diff ============================================================================== --- geronimo/sandbox/gshell/trunk/gshell-core/src/test/java/org/apache/geronimo/gshell/commandline/parser/CommandLineParserTest.java (original) +++ geronimo/sandbox/gshell/trunk/gshell-core/src/test/java/org/apache/geronimo/gshell/commandline/parser/CommandLineParserTest.java Wed May 24 23:01:55 2006 @@ -98,4 +98,14 @@ // TODO: Verify 2 plain arguments + 1 quoted // } + + public void testOpaqueArguments1() throws Exception { + String input = "a 'b -c' d"; + + ASTCommandLine cl = parse(input); + + // + // TODO: Verify 2 plain arguments + 1 opaque + // + } }