Articles tagged 'parser'

Writing a (Ruby) compiler in Ruby bottom up - step 20

You may or may not have seen my recent post where I admitted to more or less having decided to make my compiler project a Ruby compiler. On the downside this means a lot of complexity that may make it harder to follow. On the upside... Well, you get to read ...

Writing a compiler in Ruby bottom up - Milestone: It can parse itself...

Yeah, I know, it's a long time since the last part. That doesn't mean things have stopped, though I've been extremely busy.
As always, if you don't know what I'm talking about, take a look at the series.

To see what I've been up to, take a look at the Github ...

Writing a compiler in Ruby bottom up - step 18

Plugging in an operator precedence parser

The code as at the end of this part is available here.

A while back I wrote a post about writing a simple operator precedence ...

Writing a compiler in Ruby bottom up - step 17

The code as at the end of this part can be found here

I won't promise to keep up the posting frequency I've kept over the last week or so, but here's a tiny little part showing the next step. This time we're getting rid of "let". Well, sort of. I won't ...

Writing a compiler in Ruby bottom up - step 16

From now on I'm not going to cover every little change - too much of it is repetitive, but I'll keep posting parts of this series to cover major changes. If you want to keep track of the changes "blow by blow",  Read more

A simple Operator Precedence parser

Consider this an "interlude" of sorts in my series on writing a compiler, since the parser that will be presented in one of the future parts of that series depends significantly on an operator precedence parser to cut down on the amount of code.

Strawman for a new parser generator

I have very strong opinions when it comes to parser generators. Most parsers I've written have ended up being hand written or have used some half-assed parser generators I've written myself, because I've yet to find a parser generator I like. I've found many I like aspects of, but they invariably ...

BNF -> parser assembler

Ok, so tonight I set myself a goal of preparing an initial version of a BNF grammar with some extensions intended as a starting point for a tool to convert BNF into assembly for my parser assembler (I need to think of a proper name for it soon...). Here is the ...

Parser assembler, RDF and Turtle

I've kept working on my parser assembler, but it's moving slow thanks to actually having a day job to do... However tonight I mostly finished a parser for Turtle - a subset of N3 that allows convenient specification of RDF triples.

It ended up at about 1KB of bytecode, ...