avalon-cvs mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From froehl...@apache.org
Subject cvs commit: jakarta-avalon-cornerstone/apps/db/src/sql/javacc BasicSQLParser.jj
Date Thu, 29 Nov 2001 13:31:11 GMT
froehlich    01/11/29 05:31:11

  Modified:    apps/db/src/sql/javacc BasicSQLParser.jj
  Log:
  first successful run of the sql parser, yippie ;-)
  
  Revision  Changes    Path
  1.3       +23 -26    jakarta-avalon-cornerstone/apps/db/src/sql/javacc/BasicSQLParser.jj
  
  Index: BasicSQLParser.jj
  ===================================================================
  RCS file: /home/cvs/jakarta-avalon-cornerstone/apps/db/src/sql/javacc/BasicSQLParser.jj,v
  retrieving revision 1.2
  retrieving revision 1.3
  diff -u -r1.2 -r1.3
  --- BasicSQLParser.jj	2001/11/29 13:05:32	1.2
  +++ BasicSQLParser.jj	2001/11/29 13:31:11	1.3
  @@ -44,7 +44,7 @@
       public static void main(String args[]) {
           BasicSQLParser parser = new BasicSQLParser(System.in);
           try {
  -            parser.Test((String)args[0]);
  +            parser.Test();
           } catch(ParseException pe) {
               pe.printStackTrace();
           }
  @@ -135,36 +135,36 @@
   /**
    * Test Method for command line input
    */
  -void Test(String sql) :
  +void Test() :
   { }
   {
       ( 
  -        parseSQLString(sql) 
  +        parseSQLString() 
       ) ";"
   }
   
  -String parseSQLString(String sql) :
  +String parseSQLString() :
   {
       String stm;
   }
   {
       ( 
  -        stm = Select(sql)
  -        | stm = Update(sql)
  +        stm = Select()
  +        | stm = Update()
           /*
  -        | Rollback(sql)
  -        | Insert(sql)
  -        | Grant(sql)
  -        | Drop(sql)
  -        | Delete(sql)
  -        | Commit(sql)
  -        | Alter(sql)
  +        | Rollback()
  +        | Insert()
  +        | Grant()
  +        | Drop()
  +        | Delete()
  +        | Commit()
  +        | Alter()
           */
       ) ";"
       { return stm; }
   }
   
  -String Select(String sql) :
  +String Select() :
   { 
       String stm;
       Token token;
  @@ -173,18 +173,15 @@
   
   {
       <SELECT>
  +        token = <SELECT> { stm = token.image; }
           getColumns(columns)
  -        token = <SELECT>
  -        {
  -            stm = token.image;
  -        }
       <FROM>
   
       [ Where() ] //process where
       { return stm; }
   }
   
  -String Update(String sql) :
  +String Update() :
   {
        String stm;
        Token token;
  @@ -198,43 +195,43 @@
       { return stm; }
   }
   
  -void Rollback(String sql) :
  +void Rollback() :
   {}
   {
       <EOF>   
   }
   
  -void Insert(String sql) :
  +void Insert() :
   {}
   {
       <EOF>   
   }
   
  -void Grant(String sql) :
  +void Grant() :
   {}
   {
       <EOF>   
   }
   
  -void Drop(String sql) :
  +void Drop() :
   {}
   {
       <EOF>   
   }
   
  -void Delete(String sql) :
  +void Delete() :
   {}
   {
       <EOF>   
   }
   
  -void Commit(String sql) :
  +void Commit() :
   {}
   {
       <EOF>   
   }
   
  -void Alter(String sql) :
  +void Alter() :
   {}
   {
       <EOF>   
  
  
  

--
To unsubscribe, e-mail:   <mailto:avalon-cvs-unsubscribe@jakarta.apache.org>
For additional commands, e-mail: <mailto:avalon-cvs-help@jakarta.apache.org>


Mime
View raw message