Thanks very much for that, john.c - that's really useful and much appreciated!
Update - it works! Numbers print correctly now - many thanks!
Cheers - bye for now -
Andy
Type: Posts; User: latte123
Thanks very much for that, john.c - that's really useful and much appreciated!
Update - it works! Numbers print correctly now - many thanks!
Cheers - bye for now -
Andy
Hi Salem - thanks for your reply -
Points 1 and 2 - understood. I'll work on those.
Debuggers - I've hardly used them (which probably shows). At least in compiling, I always compile...
Hi all -
I'm sorry for dropping in again. (You'll be pleased to know I'm back to work tomorrow so I won't be here anywhere near as often..... :) )
Anyway - my SQL file lexer now works...
Hi Sir Galahad -
A very big thank-you for that code - it's very impressive! I'm sure it'll be very useful! That code has more of a "functional programming" flavour to it (and I'm a big fan of...
Thanks OldGuy2 - that article is great! Exactly what I was after!
I apologise to all for popping in here so much in the last few days. Anyway, thanks to the help given here (and some...
Hi all -
I'm trying to get a much better idea of the "big picture" of the lexing process.
In particular, I have noticed that of the lexers I've seen (not that many...), most of the...
Hi Hodor - thanks for that! Yes!!! It worked! Many thanks!
It's a simple app but quite satisfying to get it working.
Quite a nice example of mutually-recursive functions too..... :) ...
Hi all -
I've made huge progress with my lexer in the last day or so! The code is quite clean now and easy to follow now that I have functions for each lexeme type.
One small problem - the...
Hey stahta01 - a HUGE thanks for posting the fixed code! *Big* improvement! I've just run it and it's great!
Thanks again - cheers -
- Andy
Hi again -
Ahh..... I think I may be seeing what you mean. The code outputs positions up to 13, then it jumps to 17, 19 and 21.
If I think about it - we always want str[0] *anyway*...
Hi - thanks Hodor and stahta01 - very helpful!
As an aside (and an experiment), I've also been trying the alternative approach below (which looks very promising). It would certainly be easier...
Hi all -
I'm trying to get this lexer to work but it gives a segfault at the moment. Here's the code -
/* lex.c */
/* This code is released to the public domain. */
/* "Share and...
Hi rstanley -
Done - thanks for that! Here's the code for anyone interested -
/* search.c */
Hi again all -
I've got the code working perfectly now. The search now returns an int - code follows -
/* search.c */
/* Function to search an array of strings */
Ahhh...... thanks for that, rstanley! Should be an easy fix..... :)
Thanks again, bye for now -
- Andy
Hi all -
I've written this code to search an array of strings for a given string. Here it is -
/* search.c */
Hi again all -
Sorry to say - I'm still having problems with the SQL lexer.
It compiles but when the executable is run, it doesn't do anything - it just hangs.
The latest code is here -...
Hi john.c - thanks for both of your tips there, that's great!
I'll fix the code accordingly and I should be up and running..... :)
I'll do a parser next. That should be a bit easier...
Hi all -
I've been doing a "toy SQL lexer" and almost have it working. It compiles fine but I get this one warning -
sql_lexer.c:281:2: warning: format ‘%s’ expects argument of type ‘char...
Hi Salem - thanks very much for that - looks great!
Seems like a considerable improvement on my original code :)
Bye for now -
- latte123
Problem solved -
latte123
Hi again all -
I've managed to get this working now (yay!) .
The relevant bit of code is as follows -
void test(struct keyseq *k)
{
puts("Press Ctrl-C to quit....");
...
Hi Salem - thanks for your help!
I've now cut the code down to focus on the getch() function, only printing when it has finished.
I'm not quite there yet, but will keep going.... :)
...
Hi all -
I'm doing a little public-domain key-sequence reader - by that, I mean code that reads keys (along with any shf/alt/ctrl/esc flags) from the keyboard.
This is as part of a P.D....
Hi Barney!
Thanks very much for that - that's great!
A very elegant way to do things!
Thanks too to all others who have helped out here - your comments have been very helpful!
-...