Skip to content
GitLab
Explore
Sign in
Primary navigation
Search or go to…
Project
L
lustre-v6
Manage
Activity
Members
Labels
Plan
Issues
Issue boards
Milestones
Wiki
Code
Merge requests
Repository
Branches
Commits
Tags
Repository graph
Compare revisions
Snippets
Build
Pipelines
Jobs
Pipeline schedules
Artifacts
Deploy
Releases
Container Registry
Model registry
Operate
Environments
Monitor
Incidents
Analyze
Value stream analytics
Contributor analytics
CI/CD analytics
Repository analytics
Model experiments
Help
Help
Support
GitLab documentation
Compare GitLab plans
Community forum
Contribute to GitLab
Provide feedback
Keyboard shortcuts
?
Snippets
Groups
Projects
Show more breadcrumbs
verimag
synchrone
lustre-v6
Commits
98672e58
Commit
98672e58
authored
16 years ago
by
Erwan Jahier
Browse files
Options
Downloads
Patches
Plain Diff
forgot the lexer in the previous commit...
parent
1aab41bf
No related branches found
No related tags found
No related merge requests found
Changes
1
Hide whitespace changes
Inline
Side-by-side
Showing
1 changed file
src/lexer.mll
+11
-0
11 additions, 0 deletions
src/lexer.mll
with
11 additions
and
0 deletions
src/lexer.mll
+
11
−
0
View file @
98672e58
...
...
@@ -63,6 +63,7 @@ Hashtbl.add keywords "uses" (function x -> TK_USES x) ;;
Hashtbl
.
add
keywords
"is"
(
function
x
->
TK_IS
x
)
;;
Hashtbl
.
add
keywords
"body"
(
function
x
->
TK_BODY
x
)
;;
Hashtbl
.
add
keywords
"end"
(
function
x
->
TK_END
x
)
;;
Hashtbl
.
add
keywords
"include"
(
function
x
->
TK_INCLUDE
x
)
;;
let
is_a_keyword
(
s
:
string
)
=
(
try
...
...
@@ -104,6 +105,7 @@ let token_code tk = (
|
TK_ICONST
lxm
->
(
"TK_ICONT"
,
lxm
)
|
TK_IDENT
lxm
->
(
"TK_IDENT"
,
lxm
)
|
TK_LONGIDENT
lxm
->
(
"TK_LONGIDENT"
,
lxm
)
|
TK_STRING
lxm
->
(
"TK_STRING"
,
lxm
)
|
TK_IF
lxm
->
(
"TK_IF"
,
lxm
)
|
TK_IMPL
lxm
->
(
"TK_IMPL"
,
lxm
)
|
TK_INT
lxm
->
(
"TK_INT"
,
lxm
)
...
...
@@ -151,6 +153,8 @@ let token_code tk = (
|
TK_IS
lxm
->
(
"TK_IS"
,
lxm
)
|
TK_BODY
lxm
->
(
"TK_BODY"
,
lxm
)
|
TK_END
lxm
->
(
"TK_END"
,
lxm
)
|
TK_INCLUDE
lxm
->
(
"TK_INCLUDE"
,
lxm
)
(* | TK_QUOTE lxm -> ("TK_QUOTE" , lxm) *)
)
}
...
...
@@ -217,6 +221,7 @@ rule lexer = parse
|
"="
{
TK_EQ
(
Lxm
.
make
lexbuf
)
}
|
"."
{
TK_DOT
(
Lxm
.
make
lexbuf
)
}
(* | "\"" { TK_QUOTE ( Lxm.make lexbuf ) } *)
|
","
{
TK_COMA
(
Lxm
.
make
lexbuf
)
}
|
";"
{
TK_SEMICOL
(
Lxm
.
make
lexbuf
)
}
|
":"
{
TK_COLON
(
Lxm
.
make
lexbuf
)
}
...
...
@@ -236,6 +241,12 @@ rule lexer = parse
let
lxm
=
Lxm
.
make
lexbuf
in
TK_LONGIDENT
(
lxm
)
}
(* une chaine quelconque *)
|
"
\"
"
[
'
_'
'
A'
-
'
Z'
'
a'
-
'
z'
]
[
'
A'
-
'
Z'
'
(
'
'
)
'
'
$
'
'
/
'
'
a'
-
'
z'
'.'
'
-
'
'
_'
]
*
"
\"
"
{
let
lxm
=
Lxm
.
make_string
lexbuf
in
TK_STRING
(
lxm
)
}
(* constantes entires et relles *)
|
chiffres
{
TK_ICONST
(
Lxm
.
make
lexbuf
)
}
...
...
This diff is collapsed.
Click to expand it.
Preview
0%
Loading
Try again
or
attach a new file
.
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Save comment
Cancel
Please
register
or
sign in
to comment