You are viewing a plain text version of this content. The canonical link for it is here.
Posted to commits@cassandra.apache.org by ee...@apache.org on 2009/08/10 21:34:38 UTC
svn commit: r802908 -
/incubator/cassandra/trunk/src/java/org/apache/cassandra/cli/Cli.g
Author: eevans
Date: Mon Aug 10 19:34:38 2009
New Revision: 802908
URL: http://svn.apache.org/viewvc?rev=802908&view=rev
Log:
CASSANDRA-296 fix grammar breakage
Changeset ada820 was an attempt to make hostname parsing less stupid,
(i.e. don't allow underscores; do allow hyphens; allow IP addresses).
It didn't entirely fix the problems it set out to and it broke
parsing of anything that used the "Identifier" lexer, (for example
the thrift {get,set} ... commands).
This changeset partially reverts ada820 until a proper fix to
hostname parsing can be found.
Modified:
incubator/cassandra/trunk/src/java/org/apache/cassandra/cli/Cli.g
Modified: incubator/cassandra/trunk/src/java/org/apache/cassandra/cli/Cli.g
URL: http://svn.apache.org/viewvc/incubator/cassandra/trunk/src/java/org/apache/cassandra/cli/Cli.g?rev=802908&r1=802907&r2=802908&view=diff
==============================================================================
--- incubator/cassandra/trunk/src/java/org/apache/cassandra/cli/Cli.g (original)
+++ incubator/cassandra/trunk/src/java/org/apache/cassandra/cli/Cli.g Mon Aug 10 19:34:38 2009
@@ -85,7 +85,7 @@
connectStmt
: K_CONNECT host SLASH port -> ^(NODE_CONNECT host port)
- | K_CONNECT ip SLASH port -> ^(NODE_CONNECT ip port)
+ | K_CONNECT ipaddr SLASH port -> ^(NODE_CONNECT ipaddr port)
;
helpStmt
@@ -150,9 +150,9 @@
columnOrSuperColumn: StringLiteral;
-host: id+=HostIdentifier -> ^(NODE_ID_LIST $id+);
+host: id+=Identifier (id+=DOT id+=Identifier)* -> ^(NODE_ID_LIST $id+);
-ip: id+=IntegerLiteral id+=DOT id+=IntegerLiteral id+=DOT id+=IntegerLiteral id+=DOT id+=IntegerLiteral -> ^(NODE_ID_LIST $id+);
+ipaddr: id+=IntegerLiteral id+=DOT id+=IntegerLiteral id+=DOT id+=IntegerLiteral id+=DOT id+=IntegerLiteral -> ^(NODE_ID_LIST $id+);
port: IntegerLiteral;
@@ -195,9 +195,15 @@
: '0'..'9'
;
+fragment
+Alnum
+ : Letter
+ | Digit
+ ;
+
// syntactic Elements
Identifier
- : Letter ( Letter | Digit | '_')*
+ : Letter ( Alnum | '_' )*
;
// literals
@@ -206,14 +212,10 @@
'\'' (~'\'')* '\'' ( '\'' (~'\'')* '\'' )*
;
+
IntegerLiteral
: Digit+;
-
-HostIdentifier
- : ( Letter | Digit ) ( Letter | Digit | DOT | '-' )* ( Letter | Digit )
- ;
-
//
// syntactic elements
//