Skip to content

Commit

Permalink
Add basic Lemon parser generator support.
Browse files Browse the repository at this point in the history
  • Loading branch information
deplinenoise committed Nov 30, 2013
1 parent b128fd6 commit 0d4b127
Showing 1 changed file with 27 additions and 0 deletions.
27 changes: 27 additions & 0 deletions scripts/tundra/syntax/lemon.lua
Original file line number Diff line number Diff line change
@@ -0,0 +1,27 @@
-- lemon.lua - Support for the Lemon parser generator

module(..., package.seeall)

local path = require "tundra.path"

DefRule {
Name = "Lemon",
Command = "lemon $(<)",
ConfigInvariant = true,

Blueprint = {
Source = { Required = true, Type = "string" },
},

Setup = function (env, data)
local src = data.Source
local base_name = path.drop_suffix(src)
local gen_c = base_name .. '.c'
local gen_h = base_name .. '.h'
local gen_out = base_name .. '.out'
return {
InputFiles = { src },
OutputFiles = { gen_c, gen_h, gen_out },
}
end,
}

0 comments on commit 0d4b127

Please sign in to comment.