I need to parse a SQL command for my project using C.
The whole sql command is inputed as a string and the function should create a token list that contains all the components of the commands.
EX: "create table tab1(name char(10), id int)"
should have the token list as "create->table->tab1->(->name->char->( ->10 -> )->,->id-> int"
I try to use strtok(*command, " "to parse it. however, it doesnot put "(", "", "," into seperate tokens. The output becomes create->table->tab1(name->char(10),->id-> int"
can anyone help me? Thanks!
The whole sql command is inputed as a string and the function should create a token list that contains all the components of the commands.
EX: "create table tab1(name char(10), id int)"
should have the token list as "create->table->tab1->(->name->char->( ->10 -> )->,->id-> int"
I try to use strtok(*command, " "to parse it. however, it doesnot put "(", "", "," into seperate tokens. The output becomes create->table->tab1(name->char(10),->id-> int"
can anyone help me? Thanks!