[Mulgara-svn] r359 - branches/nw-interface/src/jar/itql/sablecc

pag at mulgara.org pag at mulgara.org
Tue Aug 21 05:37:59 UTC 2007


Author: pag
Date: 2007-08-21 00:37:58 -0500 (Tue, 21 Aug 2007)
New Revision: 359

Modified:
   branches/nw-interface/src/jar/itql/sablecc/itql.grammar
Log:
Attempted to add language tag support

Modified: branches/nw-interface/src/jar/itql/sablecc/itql.grammar
===================================================================
--- branches/nw-interface/src/jar/itql/sablecc/itql.grammar	2007-08-21 05:37:21 UTC (rev 358)
+++ branches/nw-interface/src/jar/itql/sablecc/itql.grammar	2007-08-21 05:37:58 UTC (rev 359)
@@ -24,7 +24,8 @@
   esc,  /* escaping character in quoted literal with '\' */
   lit,  /* quoted literal */
   res,  /* tagged resource */
-  var;  /* escaping variable name with '$' */
+  var,  /* escaping variable name with '$' */
+  lng;  /* language code */
 
 Tokens
   {def}                alias       = 'alias';
@@ -91,9 +92,11 @@
   {def->res}           url        = '<';
   {res->def}           endurl     = '>';
   {def}                datatypeprefix = '^^';
-  {def->var}           variableprefix = '$';
+  {def->lng}           languageprefix = '@';
+  {def->var}           variableprefix = ('$' | '?');
   {def}                number     = digit+;
   {def}                float      = digit+ ('.' digit*) | ('.' digit+);
+  {lng->def}           langid      = letter letter | letter letter '-' letter letter;
 
   {res}                resource    = urlchar*;
   {def->lit, lit->def} quote       = 39;  /* ' */
@@ -300,7 +303,7 @@
     {subquery} subquery ;
 
   literal =
-    [opening]:quote strand* [closing]:quote datatype?;
+    [opening]:quote strand* [closing]:quote language? datatype?;
 
   strand =
     {unescaped} text |
@@ -309,6 +312,9 @@
   datatype =
     datatypeprefix resource;
 
+  language =
+    languageprefix langid;
+
   variable =
     variableprefix identifier;
 




More information about the Mulgara-svn mailing list