problem with Lex.
Page 1 of 19 Replies - 422 Views - Last Post: 24 December 2012 - 08:36 PM
#1
problem with Lex.
Posted 23 December 2012 - 07:36 PM
NOTE: I am just trying to create a simple programming language, nothing too sophisticated..
Replies To: problem with Lex.
#2
Re: problem with Lex.
Posted 24 December 2012 - 02:40 AM
#3
Re: problem with Lex.
Posted 24 December 2012 - 07:57 AM
sepp2k, on 24 December 2012 - 02:40 AM, said:
Ah, glad to see you seen this! And I see, I have ANTLR, does that work? And I'll look at YACC. I've been reading on EBNF, and I'm not quite understanding some of it.
If you don't mind, I have some questions, you can contact me at <Removed>, you'll probably get the quickest replies out of me that way. Either way is fine with me. I just need some questions answered for me to fully understand this.
Thanks!
Shandan
This post has been edited by macosxnerd101: 24 December 2012 - 08:39 PM
Reason for edit:: Removed email per site policies. Please keep all work via the forums.
#4
Re: problem with Lex.
Posted 24 December 2012 - 08:07 AM
sepp2k, on 24 December 2012 - 02:40 AM, said:
Also, I thought, I'd just might add, that I'm going to be keeping a blog on my experiences of creating a programming language, so if you're any interested you might wanna check it out!
#5
Re: problem with Lex.
Posted 24 December 2012 - 08:12 AM
#6
Re: problem with Lex.
Posted 24 December 2012 - 08:23 AM
#7
Re: problem with Lex.
Posted 24 December 2012 - 10:02 AM
shandan97, on 24 December 2012 - 03:36 AM, said:
Can you explain what you mean by that exactly? Where who is getting which code from?
Quote
Yes, a grammar is a description of the syntax of a programming language.
shandan97, on 24 December 2012 - 03:57 PM, said:
If you don't have to use Lex, ANTLR is a perfectly fine option. In fact I'd say it's preferable to lex+yacc / flex+bison.
#8
Re: problem with Lex.
Posted 24 December 2012 - 10:19 AM
sepp2k, on 24 December 2012 - 10:02 AM, said:
shandan97, on 24 December 2012 - 03:36 AM, said:
Can you explain what you mean by that exactly? Where who is getting which code from?
Quote
Yes, a grammar is a description of the syntax of a programming language.
shandan97, on 24 December 2012 - 03:57 PM, said:
If you don't have to use Lex, ANTLR is a perfectly fine option. In fact I'd say it's preferable to lex+yacc / flex+bison.
Well, I've looked at multiple examples of programming language grammar, but I don't really get it. I think what I really need explained is what a lex token is and what they do. That's what I'm having the most issues with. And I'm probably going to try YACC and see what that is like, thanks for the suggestion.
#9
Re: problem with Lex.
Posted 24 December 2012 - 10:33 AM
#10
Re: problem with Lex.
Posted 24 December 2012 - 08:36 PM
Quote
If that is the case, you need study a little theory before delving into tools. There are plenty of lectures, books, etc. for learning compiler/language design. The dragon book is a good starting place. A gentler introduction is Programming Language Pragmatics. Also check out my tutorial.
As far as picking a tool, I recommend Flex/Bison for C/C++ or JLex/CUP for Java.
|
|

New Topic/Question
Reply



MultiQuote




|