Skip to content
Projects
Groups
Snippets
Help
Loading...
Help
Support
Keyboard shortcuts
?
Submit feedback
Contribute to GitLab
Sign in / Register
Toggle navigation
M
mariadb
Project overview
Project overview
Details
Activity
Releases
Repository
Repository
Files
Commits
Branches
Tags
Contributors
Graph
Compare
Issues
0
Issues
0
List
Boards
Labels
Milestones
Merge Requests
0
Merge Requests
0
Analytics
Analytics
Repository
Value Stream
Wiki
Wiki
Snippets
Snippets
Members
Members
Collapse sidebar
Close sidebar
Activity
Graph
Create a new issue
Commits
Issue Boards
Open sidebar
Kirill Smelkov
mariadb
Commits
05e97fc7
Commit
05e97fc7
authored
Mar 28, 2006
by
osku
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
Add make_flex.sh and update lexer/parser generation documentation.
parent
57341d44
Changes
3
Hide whitespace changes
Inline
Side-by-side
Showing
3 changed files
with
24 additions
and
21 deletions
+24
-21
pars/make_bison.sh
pars/make_bison.sh
+1
-2
pars/make_flex.sh
pars/make_flex.sh
+20
-0
pars/pars0lex.l
pars/pars0lex.l
+3
-19
No files found.
pars/make_bison.sh
View file @
05e97fc7
#!/bin/bash
#
# regenerate parser from bison input files as documented at the top of
# pars0lex.l.
# generate parser files from bison input files.
set
-eu
...
...
pars/make_flex.sh
0 → 100755
View file @
05e97fc7
#!/bin/bash
#
# generate lexer files from flex input files.
set
-eu
TMPFILE
=
_flex_tmp.c
OUTFILE
=
lexyy.c
flex
-o
$TMPFILE
pars0lex.l
# AIX needs its includes done in a certain order, so include "univ.i" first
# to be sure we get it right.
echo
'#include "univ.i"'
>
$OUTFILE
# flex assigns a pointer to an int in one place without a cast, resulting in
# a warning on Win64. this adds the cast.
sed
-e
's/int offset = (yy_c_buf_p) - (yytext_ptr);/int offset = (int)((yy_c_buf_p) - (yytext_ptr));/;'
<
$TMPFILE
>>
$OUTFILE
rm
$TMPFILE
pars/pars0lex.l
View file @
05e97fc7
...
...
@@ -12,27 +12,11 @@ not automatically generate them from pars0grm.y and pars0lex.l.
How to make the InnoDB parser and lexer C files:
1. First do
bison -d pars0grm.y
That generates pars0grm.tab.c and pars0grm.tab.h.
1. Run ./make_flex.sh to generate lexer files.
2. R
ename pars0grm.tab.c to pars0grm.c and pars0grm.tab.h to pars0grm.h
.
2. R
un ./make_bison.sh to generate parser files
.
3. Copy pars0grm.h also to /innobase/include
4. Do
flex pars0lex.l
That generates lex.yy.c.
5. Rename lex.yy.c to lexyy.c.
6. Add '#include "univ.i"' before #include <stdio.h> in lexyy.c
(Needed for AIX)
7. Add a type cast to int to the assignment below the comment
'need more input.' (Removes a warning on Win64)
These instructions seem to work at least with bison-1.28 and flex-2.5.4 on
These instructions seem to work at least with bison-1.875d and flex-2.5.31 on
Linux.
*******************************************************/
...
...
Write
Preview
Markdown
is supported
0%
Try again
or
attach a new file
Attach a file
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Cancel
Please
register
or
sign in
to comment