llgen.pm 839 B

12345678910111213141516171819202122232425262728293031323334353637
  1. -- $Source$
  2. -- $State$
  3. -- This is unpleasant. LLgen can generate an arbitrary number of output files,
  4. -- which means we need our own output filename generator.
  5. LLgen = simple {
  6. class = "LLgen",
  7. command = {
  8. "rm -f %out%",
  9. "cd %out[1]:dirname% && %TOOLDIR%LLgen %in%"
  10. },
  11. outputs = {"%U%/" },
  12. __outputs = function(self, inputs)
  13. local o = simple.__outputs(self, inputs)[1]
  14. local outputs = {o.."Lpars.h", o.."Lpars.c"}
  15. for _, i in ipairs(inputs) do
  16. i = string.gsub(i, "^.*/", "")
  17. i = string.gsub(i, "%.g$", ".c")
  18. table.insert(outputs, o..i)
  19. end
  20. return outputs
  21. end
  22. }
  23. -- Revision history
  24. -- $Log$
  25. -- Revision 1.2 2006-11-11 22:59:01 dtrg
  26. -- Now uses the version of LLgen included with the ACK instead of the standalone version.
  27. --
  28. -- Revision 1.1 2006/07/20 23:18:18 dtrg
  29. -- First version in CVS.
  30. --