haasn / -g-pl

/g/ programming language
13 stars 2 forks source link

Finite State Machine and Lexer #5

Closed yate closed 13 years ago

yate commented 13 years ago

Hey,

OP from the original thread here. Once the language has been defined I'll be glad to start making a finite state machine and start on the lexical analyzer.

Things we'll need for the lexer -list of reserved words -type definitions (looks like we have most in the draft.txt) -identifier definition (most likely C style, can't start with digit) -comment definitions (check)

And what language will the compiler be written in. I know java best, but any C-like language I could manage. C would be my language of choice only because I want to get to know it better. Thoughts?

graydude commented 13 years ago

Hey,

I'm the dude that posted the gray text on the gray background, remember me?

C would be fine, but we could also have multiple as soon as we have a formal specification. It doesn't need to be tied to one language. But it would be awesome if you would like to implemented that would be great! Thanks in advance,

graydude

yate commented 13 years ago

That's true. The way I was picturing it, at least just for lexer and parser, was that the parser would be calling the lexer to get the next token in the stream, which would mean at least the parser and lexer would have to be the same language. I'm in the middle of my compiler course, so right now I honestly don't know how the rest of it will fit together. Doing it in the same language seems less troublesome.

graydude commented 13 years ago

Ok great, what do you study? I'm in my second year of CS. I wonder when nand shows up again...

yate commented 13 years ago

third year CS

haasn commented 13 years ago

I've added a list of reserved names

haasn commented 13 years ago

I wrote you an EBNF detailing how I parse it so you can just follow that blindly to adhere to the specification.

It should fulfill all of your mentioned criteria.