[Top][All Lists]
[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]
pass an argument to yylex()?
From: |
Tribulations Parallèles |
Subject: |
pass an argument to yylex()? |
Date: |
Sat, 29 Oct 2005 19:09:18 +0200 |
User-agent: |
KMail/1.8 |
Hello everybody,
I am using lex to scan a file and put in memory some tokens (coefficients of
vectors and arrays, in fact). I put them in a memory structure of type "bar"
with a given name, say "foo". I declare foo as a global variable (in the
first section of my lex.yy file) so as to be able to access it in my main
program ("extern bar foo"). I can access it after the call "yylex()".
I would like to be able to choose the name of my variable, and avoid global
variables, so I would like to declare my variable foo in the main program,
and pass it to yylex() in some way: for example yylex(foo).
But in all the examples that I have seen, yylex has no argument. I haven't
seen anything in the documentation.
Is it possible to perform what I aim to do?
Thanks in advance,
Julien
[Prev in Thread] |
Current Thread |
[Next in Thread] |
- pass an argument to yylex()?,
Tribulations Parallèles <=