[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]
Parsing an Oracle script
I've trying to use SableCC to parse the Oracle
script but I got the skrip3.parser.ParserException: [10,7] "TTable
expected." error message.Can you help me what's wrong with my specification
file? Here my specification file and oracle script that I
parsed.
Production in specification file
Productions
statements =
{script}
statement statements |
{empty}
;
statement
=
/***********************************************************************
*Deklarasi
untuk entitas kuat, entitas lemah atau relasi many to many
*
***********************************************************************/
{table_create_sl}
create table
entity_name r_par atributs l_par mcharacters* slash;
entity_name =
{entity_name}
identifier;
atributs =
{atributs} atribut comma atributs |
{atrwithpri} atribut comma primary_def;
atribut =
{atribut} atr_name data_type status?
primary_key |
/* {atrwithchar1} atr_name data_type
characters? status? comma |
{atrwithchar2}
atr_name data_type status? characters? comma | */
{atrwithconst} atr_name data_type status? constraint pri_name_key
primary_key characters* comma;
atr_name =
{atr_name}
identifier;
primary_def =
{primary_def}
constraint pri_name_key
primary_key r_par pri_name_atr l_par;
pri_name_key =
{pri_name_key}
identifier;
pri_name_atr =
{pri_name_atr}
pri_name_atr comma identifier
|
identifier;
Oracle script that i parsed:
--
============================================================
--
Database name:
MODEL_31
-- DBMS name: ORACLE Version
8
-- Created on: 10/12/00 11:12
AM
-- ============================================================
--
============================================================
--
Table:
MEMBER
-- ============================================================
create
table member
(
MEMBER_ID
CHAR(10)
not null,
MEMBER_NAME
CHAR(20)
not null,
MEMBER_ADDRESS
CHAR(40)
not null,
MEMBER_IS_ADMIN
NUMBER(1)
not null,
MEMBER_ACTIVE
NUMBER(1)
not null,
DATE_IN
DATE
not null,
DATE_OUT
DATE
not null,
constraint PK_MEMBER primary key
(MEMBER_ID)
)
/