Class Lisp::Format::Parser
In: lib/facet/lisp-format.rb
Parent: Object

Given a lexer, parses the tokens it constructs. It works, quite simply, by maintaining a stack of nesting levels and directives/tokens are added to the current stack level. When a directive removes a level of nesting the previous level’s last directive gets connected, using Directive#connect.

Methods

new   parse  

Public Class methods

Create a Parser, given a Lexer, lexer.

Public Instance methods

Do the actual parsing of the tokens. Returns a list of the top-level tokens to run.

[Validate]