Permalink
Browse files

Redmine#2111: Bring in peg 0.13 under 3rdparty/

  • Loading branch information...
1 parent 0e465b5 commit f0cda23daae526fdc5de588d0d90d5efad4f3089 @tzz tzz committed Sep 10, 2013
Showing with 7,668 additions and 0 deletions.
  1. +14 −0 3rdparty/peg-0.1.13/LICENSE.txt
  2. +42 −0 3rdparty/peg-0.1.13/README.txt
  3. +6 −0 3rdparty/peg-0.1.13/build-mac.sh
  4. +5 −0 3rdparty/peg-0.1.13/build-win.cmd
  5. +11 −0 3rdparty/peg-0.1.13/examples/accept.c
  6. +8 −0 3rdparty/peg-0.1.13/examples/accept.peg
  7. +32 −0 3rdparty/peg-0.1.13/examples/accept.ref
  8. +361 −0 3rdparty/peg-0.1.13/examples/basic.leg
  9. +10 −0 3rdparty/peg-0.1.13/examples/basic.ref
  10. +8 −0 3rdparty/peg-0.1.13/examples/bench.bas
  11. +46 −0 3rdparty/peg-0.1.13/examples/calc.leg
  12. +3 −0 3rdparty/peg-0.1.13/examples/calc.ref
  13. +17 −0 3rdparty/peg-0.1.13/examples/dc.c
  14. +27 −0 3rdparty/peg-0.1.13/examples/dc.peg
  15. +1 −0 3rdparty/peg-0.1.13/examples/dc.ref
  16. +20 −0 3rdparty/peg-0.1.13/examples/dcv.c
  17. +34 −0 3rdparty/peg-0.1.13/examples/dcv.peg
  18. +3 −0 3rdparty/peg-0.1.13/examples/dcv.ref
  19. +27 −0 3rdparty/peg-0.1.13/examples/erract.leg
  20. +4 −0 3rdparty/peg-0.1.13/examples/erract.ref
  21. +17 −0 3rdparty/peg-0.1.13/examples/fibonacci.bas
  22. +17 −0 3rdparty/peg-0.1.13/examples/left.c
  23. +3 −0 3rdparty/peg-0.1.13/examples/left.peg
  24. +24 −0 3rdparty/peg-0.1.13/examples/localleg.leg
  25. +1 −0 3rdparty/peg-0.1.13/examples/localleg.ref
  26. +13 −0 3rdparty/peg-0.1.13/examples/localpeg.c
  27. +10 −0 3rdparty/peg-0.1.13/examples/localpeg.ref
  28. +11 −0 3rdparty/peg-0.1.13/examples/rule.c
  29. +8 −0 3rdparty/peg-0.1.13/examples/rule.peg
  30. +32 −0 3rdparty/peg-0.1.13/examples/rule.ref
  31. +12 −0 3rdparty/peg-0.1.13/examples/test.bas
  32. +8 −0 3rdparty/peg-0.1.13/examples/test.c
  33. +13 −0 3rdparty/peg-0.1.13/examples/test.peg
  34. +10 −0 3rdparty/peg-0.1.13/examples/test.ref
  35. +14 −0 3rdparty/peg-0.1.13/examples/username.leg
  36. +22 −0 3rdparty/peg-0.1.13/examples/wc.leg
  37. +55 −0 3rdparty/peg-0.1.13/examples/wc.ref
  38. +75 −0 3rdparty/peg-0.1.13/leg.vcxproj
  39. +19 −0 3rdparty/peg-0.1.13/leg.vcxproj.filters
  40. +81 −0 3rdparty/peg-0.1.13/peg.gyp
  41. +27 −0 3rdparty/peg-0.1.13/peg.sln
  42. +75 −0 3rdparty/peg-0.1.13/peg.vcxproj
  43. +19 −0 3rdparty/peg-0.1.13/peg.vcxproj.filters
  44. +317 −0 3rdparty/peg-0.1.13/peg.xcodeproj/project.pbxproj
  45. +817 −0 3rdparty/peg-0.1.13/src/compile.c
  46. +1,428 −0 3rdparty/peg-0.1.13/src/leg.c
  47. +298 −0 3rdparty/peg-0.1.13/src/leg.leg
  48. +1,093 −0 3rdparty/peg-0.1.13/src/peg.1
  49. +173 −0 3rdparty/peg-0.1.13/src/peg.c
  50. +77 −0 3rdparty/peg-0.1.13/src/peg.peg
  51. +1,068 −0 3rdparty/peg-0.1.13/src/peg.peg-c
  52. +366 −0 3rdparty/peg-0.1.13/src/tree.c
  53. +111 −0 3rdparty/peg-0.1.13/src/tree.h
  54. +3 −0 3rdparty/peg-0.1.13/src/version.h
  55. +562 −0 3rdparty/peg-0.1.13/win/getopt.c
  56. +95 −0 3rdparty/peg-0.1.13/win/getopt.h
  57. +9 −0 3rdparty/peg-0.1.13/win/libgen.h
  58. +6 −0 3rdparty/peg-0.1.13/win/unistd.h
@@ -0,0 +1,14 @@
+Copyright (c) 2007-2013, Ian Piumarta
+All rights reserved.
+
+Permission is hereby granted, free of charge, to any person obtaining a copy
+of this software and associated documentation files (the 'Software'), to deal
+in the Software without restriction, including without limitation the rights
+to use, copy, modify, merge, publish, distribute, and/or sell copies of the
+Software, and to permit persons to whom the Software is furnished to do so,
+provided that the above copyright notice(s) and this permission notice appear
+in all copies or substantial portions of the Software. Inclusion of the the
+above copyright notice(s) and this permission notice in supporting
+documentation would be appreciated but is not required.
+
+THE SOFTWARE IS PROVIDED 'AS IS'. USE ENTIRELY AT YOUR OWN RISK.
@@ -0,0 +1,42 @@
+Building on a Unix-like system
+------------------------------
+
+Type 'make' or 'make test'.
+
+The latter builds all the examples and runs them, comparing their
+output with the expected output.
+
+Type 'make install' to install the binaries and manual page under
+/usr/local. (Type 'make uninstall' to remove them.) You may have to
+do this using 'sudo' or while logged in as root.
+
+Edit 'Makefile' to change the way things are built and/or the places
+where things are installed.
+
+
+Building on MacOS X
+-------------------
+
+Run the 'build-mac.sh' script from a terminal or by double-clicking on
+it in the Finder.
+
+You will need Xcode. The provided project is known to work with Xcode
+versions 3.2.6 and 4.3.2.
+
+Modify build-mac.sh and/or peg.xcodeproj to change the way things are
+built.
+
+
+Building on Windows
+-------------------
+
+Run the 'build-win.cmd' script.
+
+You will need Visual Studio 2010 Express.
+
+Modify build-win.cmd, leg.vcxproj, leg.vcxproj.filters, peg.gyp,
+peg.sln, peg.vcxproj and/or peg.vcxproj.filters to change the way
+things are built.
+
+Local implementations of getopt() and basename() are provided in the
+'win' directory.
@@ -0,0 +1,6 @@
+#!/bin/bash
+
+xcodebuild -project peg.xcodeproj -configuration Release
+
+cp build/Release/peg ./
+cp build/Release/leg ./
@@ -0,0 +1,5 @@
+@echo off
+call "%VS100COMNTOOLS%vsvars32.bat"
+msbuild peg.sln /p:Configuration=Release
+
+xcopy /Y /D Release\*.exe .\
@@ -0,0 +1,11 @@
+#include <stdio.h>
+#include <stdlib.h>
+
+#include "accept.peg.c"
+
+int main()
+{
+ while (yyparse());
+
+ return 0;
+}
@@ -0,0 +1,8 @@
+start <- abcd+
+
+abcd <- 'a' { printf("A %d\n", yypos); } bc { printf("ABC %d\n", yypos); } &{YYACCEPT}
+ / 'b' { printf("B %d\n", yypos); } cd { printf("BCD %d\n", yypos); } &{YYACCEPT}
+
+bc <- 'b' { printf("B %d\n", yypos); } 'c' { printf("C %d\n", yypos); }
+
+cd <- 'c' { printf("C %d\n", yypos); } 'd' { printf("D %d\n", yypos); }
@@ -0,0 +1,32 @@
+A 3
+B 3
+C 3
+ABC 3
+B 3
+C 3
+D 3
+BCD 3
+A 3
+B 3
+C 3
+ABC 3
+B 3
+C 3
+D 3
+BCD 3
+A 3
+B 3
+C 3
+ABC 3
+B 3
+C 3
+D 3
+BCD 3
+A 3
+B 3
+C 3
+ABC 3
+B 3
+C 3
+D 3
+BCD 3
Oops, something went wrong.

0 comments on commit f0cda23

Please sign in to comment.