BSD Ports

textproc/ruby-treetop 1.6.18 NetBSD

Ruby-based text parsing and interpretation DSL

System
NetBSD
Repository
pkgsrc
Maintainer
[email protected]
License
mit
Categories
textproc, ruby
Package size
211.1 KiB, 740.0 KiB installed

Description

Languages can be split into two components, their *syntax* and their *semantics*. It's your understanding of English syntax that tells you the stream of words "Sleep furiously green ideas colorless" is not a valid sentence. Semantics is deeper. Even if we rearrange the above sentence to be "Colorless green ideas sleep furiously", which is syntactically correct, it remains nonsensical on a semantic level. With Treetop, you'll be dealing with languages that are much simpler than English, but these basic concepts apply. Your programs will need to address both the syntax and the semantics of the languages they interpret.

Treetop equips you with powerful tools for each of these two aspects of interpreter writing. You'll describe the syntax of your language with a *parsing expression grammar*. From this description, Treetop will generate a Ruby parser that transforms streams of characters written into your language into *abstract syntax trees* representing their structure. You'll then describe the semantics of your language in Ruby by defining methods on the syntax trees the parser generates.

Install

Binary package:

pkgin install ruby33-treetop

From pkgsrc:

cd /usr/pkgsrc/textproc/ruby-treetop && make install clean

Packages

The version each package repository carries. “-” means the repository builds no package of it, “n/a” that there is no such repository.

RepositoryVersion
NetBSD 10.1 x86_641.6.18
NetBSD 10.1 aarch641.6.18
SmartOS / illumos x86_641.6.18
macOS 15 arm641.6.18

Dependencies

Run dependencies 2

No port depends on this one.

Configuration

No options to configure.

Service scripts
none
Flavors
ruby34-treetop-1.6.18, ruby40-treetop-1.6.18