Commit Graph

336 Commits

Author SHA1 Message Date
yhirose
2d276c8cd9 Fix #63 2019-07-09 21:49:15 -04:00
Mura
f3e88afd39
Update peglib.h
This '#else' directive does not have such extra condition in C++.
2019-04-26 09:00:38 +09:00
Yuji Hirose
55add1dacb Fix #60 2019-04-08 11:40:27 -04:00
Yuji Hirose
57f866c6ca Fixed build error 2019-02-14 10:17:21 -05:00
Yuji Hirose
b330799cd6 Added name in SemanticValues 2019-02-14 10:11:12 -05:00
yhirose
2dcdafe3cb Fixed problem with choice and choice count 2019-02-12 22:50:23 -05:00
yhirose
559836cda1 Removed enabler 2019-01-11 18:20:04 -05:00
yhirose
15c19e4a0f fix #55 2018-11-29 20:19:46 -05:00
yhirose
b76e4fe305 Keep selected rule id in AST 2018-11-16 13:36:52 -05:00
yhirose
757e81e63d fix #52. Changed to allow Action handler taking non const SemanticValues
parameter
2018-10-07 09:25:12 -04:00
yhirose
5b3ad705c4 Retab 2018-10-06 22:29:51 -04:00
yhirose
304029a8d3 fix #53 2018-10-06 17:11:51 -04:00
yhirose
c006918329 Merge branch 'unicode' 2018-09-16 12:58:10 -04:00
yhirose
452aea18cd UTF encoding support 2018-09-16 12:57:03 -04:00
yhirose
79a3c75846 Removed 'user defined rule' feature 2018-09-13 22:44:04 -04:00
Mirko
fc03a32d1f extended parameters for enter and leave callbacks 2018-09-03 23:01:22 +02:00
Mirko
99380c2d72 added method get_rule_names() to parser class 2018-09-03 21:20:05 +02:00
yhirose
6dc7b38b4e Changed operator= in Definition to return Action 2018-08-03 21:07:42 -04:00
yhirose
5445b5c2bb fix #41 2018-07-29 13:49:00 -04:00
yhirose
6584bfa5c6 Changed to setup is_token at a better place 2018-07-28 21:51:11 -04:00
yhirose
6f9d19463d Code cleanup 2018-07-27 22:47:00 -04:00
yhirose
bbd8e68b71 Macro support (fix #25) 2018-07-27 17:16:35 -04:00
Remigiusz Kołłątaj
ba6efeae90 Backporting "undefined reference to peg::enabler" fix to all versions older than 5.0.0; Fix tests to compile with clang 3.5.
Signed-off-by: Remigiusz Kołłątaj <remigiusz.kollataj@mobica.com>
2018-07-22 10:57:46 +02:00
yhirose
9c3da8d6af Name refactoring 2018-07-20 22:56:13 -04:00
yhirose
9980eea1cd Fixed problems with backreference 2018-07-20 22:09:54 -04:00
yhirose
f0d2c529ba Back reference support 2018-07-13 17:51:20 -04:00
yhirose
a77edadfa7 Added %word rule 2018-07-13 17:26:57 -04:00
yhirose
ca950520ef Removed the simple interface 2018-07-12 19:03:57 +02:00
yhirose
bfa23401e5 Removed unused function 2018-05-28 21:06:38 -04:00
yhirose
31dd2dae29 Fixed #29 2018-01-04 19:36:34 -05:00
yhirose
e72b630455 Added line_info method on SemanticValues. 2017-11-03 22:27:08 -04:00
yhirose
02c35f7752 Updated copyright and readme. 2017-08-25 09:04:02 -04:00
yhirose
dcdfd9fdb7 Changed ast_to_s to be customizable. 2017-08-17 01:39:30 -04:00
yhirose
deac9d4c42 Code cleanup 2017-06-08 23:03:21 +09:00
yhirose
79f4d90c19 Code cleanup. 2017-04-14 21:57:28 -04:00
yhirose
ff3d947fd4 Added optimize_ast 2017-03-28 22:50:05 -04:00
yhirose
6b63bd48af Added peg::udl for 'tag' user defined literal. 2017-03-25 18:28:15 -04:00
yhirose
21934dd1ce Fixed #22. 2016-10-27 20:28:03 -04:00
hvellyr
bc9234a25f Fix compiler warning about reserved identifier
Warning was (on clang-3.7):

/Users/gck/dev/cpp-peglib/test/../peglib.h:9:9: warning: macro name is a
      reserved identifier [-Wreserved-id-macro]
#define _CPPPEGLIB_PEGLIB_H_
2016-06-07 11:51:11 +02:00
hvellyr
f764e9a85d Fix warning about loss of precission 2016-06-07 11:51:07 +02:00
hvellyr
47f8eb171c Fix compiler warnings about incomplete override functions
The warning on VS2013 was:

warning C4266: 'void peg::Ope::Visitor::visit(peg::Whitespace &)' : no
  override available for virtual member function from base
  'peg::Ope::Visitor'; function is hidden

I'm surprised that this warning doesn't happen on gcc/clang though.
2016-06-07 11:50:56 +02:00
yhirose
7b78a1c00f Removed 'user defined rule' feature. 2016-06-02 17:52:21 -04:00
hvellyr
546942e389 Make use of \u2190 char optional
VS2010 is not capable of compiling source code with chars beyond the
"current code page" reliably.
2016-06-01 16:27:24 +02:00
hvellyr
8363407768 Fix compiler warnings about "hidden" names 2016-06-01 16:27:24 +02:00
hvellyr
15ce11b594 Fix compiler warning about missing "name" parameter 2016-06-01 16:27:24 +02:00
hvellyr
2b2b171cbd Fix sign/unsigned compiler warnings 2016-06-01 16:27:24 +02:00
hvellyr
5cac962f18 Fix compiler warning about "old style cast" 2016-06-01 16:27:24 +02:00
hvellyr
5d3d63cf11 Provide explicit copy operator declaration to avoid compiler warning 2016-06-01 16:27:24 +02:00
hvellyr
d95cef6c1b Fix compiler warnings about unused method parameters 2016-06-01 16:27:24 +02:00
hvellyr
f62a726166 Avoid C++14 feature in peglib.h
... which allows to use peglib.h in a C++11 only environment.
2016-06-01 16:27:24 +02:00
hvellyr
86f903b65e Fix compiler warning about unnecessary ";"
... on clang-3.7
2016-06-01 16:27:23 +02:00
yhirose
80f822ac59 Fix token problem in AST 2016-01-24 11:12:50 -05:00
yhirose
ae400aa218 Supported . 2016-01-23 22:15:15 -05:00
yhirose
5b88443270 Major change in the way to handle token boundary. 2016-01-23 22:07:25 -05:00
yhirose
9ce4597ef6 Merge branch 'master' of https://github.com/yhirose/cpp-peglib 2015-12-31 19:44:02 -05:00
yhirose
91fe3b755c Code cleanup. 2015-12-31 19:42:14 -05:00
Jerry Evans
be0ad37263 VS2013 requires return type for auto 2015-12-08 16:46:31 +00:00
yhirose
fe9141fd0f Removed noexcept. 2015-12-07 17:33:10 -05:00
yhirose
21f555639e Code cleanup. 2015-12-06 23:01:27 -05:00
yhirose
568bf15ed3 Fixed problems with the %whitespace rule. 2015-12-03 18:59:12 -05:00
yhirose
a9cea16325 Renamed 'before/after' to 'enter/exit'. 2015-12-02 22:52:18 -05:00
yhirose
69ede706f0 Fixed build errors. Switched to CMake build system completely. 2015-11-30 17:26:06 -05:00
yhirose
f33e76249a Added trace feature. 2015-11-29 23:07:02 -05:00
yhirose
1ac16f3184 Fixed incorrect semantic values with NotPredicate. 2015-11-29 13:07:06 -05:00
yhirose
80d1488b42 Fixed ast dump format problem. 2015-11-29 11:06:28 -05:00
Yuji Hirose
3f5d54f811 Removed print_ast, and added ast_to_s. 2015-11-27 15:32:17 -05:00
yhirose
a7444fa83b Fixed #8. 2015-11-26 16:48:00 -05:00
yhirose
33978023cf Added automatic whitespace skipping feature. 2015-11-26 16:48:00 -05:00
Jerry Evans
05ac20f799 Parenthesize std::min for windows.h macro collision avoidance. 2015-11-26 12:45:01 +00:00
Jerry Evans
c27602172f Fix for ancient min/max macros in windows.h
Disable constexpr for VS2013
Guard against older versions of VC++
2015-11-23 15:27:20 +00:00
yhirose
1247271966 Improved error report. 2015-11-17 06:16:46 -05:00
yhirose
5b9daaf090 Restored before/after handlers. 2015-11-17 06:10:32 -05:00
yhirose
0e23f8f0b2 Removed unnecessary code. 2015-09-25 15:21:12 -04:00
yhirose
337741e17e Fixed build errors. 2015-08-27 22:26:34 -04:00
yhirose
b9c9216788 Changed namespace/class names. 2015-08-10 16:37:56 -04:00
yhirose
23737a716b Fixed warnings. 2015-08-10 16:37:25 -04:00
yhirose
a3cfd1b8ad Handled UTF-8 codes from 0x80 as valid identifier codes. 2015-08-08 20:30:05 -04:00
yhirose
b035706a0b Fixed compile errors with g++ 5.1. 2015-08-07 23:49:21 -04:00
yhirose
5ebd01c846 Code cleanup. 2015-08-06 18:27:38 -04:00
yhirose
6fefd8ea84 Code cleanup. 2015-08-06 13:59:23 -04:00
yhirose
53ead0be7c Fixed backtracking problem. 2015-08-05 23:45:59 -04:00
yhirose
85eb054106 Fixed backtracking problem in OneOrMore. 2015-08-05 23:37:56 -04:00
yhirose
6b690dd3cb Fixed backtrack problem. 2015-08-05 22:52:08 -04:00
yhirose
2510a22bc5 Code cleanup. 2015-08-04 13:04:23 -04:00
yhirose
aa78055654 Fixed problem with AST. 2015-08-04 11:27:37 -04:00
yhirose
5022bef3d7 Added symbol table to PL/0. 2015-08-03 17:53:35 -04:00
yhirose
65d1d99b2b Added AstOptimizer. 2015-07-31 13:06:31 -04:00
yhirose
7969d2b75c Improved AST printing. 2015-07-30 17:24:28 -04:00
yhirose
552c7012f4 Changed PEGLIB_HAS_CONSTEXPR_SUPPORT TO BE PEGLIB_NO_CONSTEXPR_SUPPORT. 2015-07-30 17:23:31 -04:00
yhirose
5a09846a15 Fixed crash problem with ast. 2015-07-29 21:47:58 -04:00
yhirose
e8ca00acb5 Added print feature to debugger. 2015-07-29 17:58:20 -04:00
yhirose
5d6755ff64 Added command-line debugger support. 2015-07-28 06:47:18 -04:00
yhirose
0e0e3f6f24 Code cleanup. 2015-07-25 14:58:29 -04:00
yhirose
c0857d19ec Changed to use constexpr. 2015-07-24 21:36:39 -04:00
yhirose
672f7740d8 Added Object support. 2015-07-22 21:14:55 -04:00
yhirose
8b08ca3cca Added assert function. 2015-07-07 15:44:33 -04:00
yhirose
6795c56c47 Added str() in SemanticValue. 2015-06-16 13:15:27 -04:00
yhirose
d943c4fade Fixed build problem with VC++. 2015-06-16 11:26:48 -04:00
yhirose
20c303d6e9 Simplified API. 2015-06-16 01:01:02 -04:00
yhirose
c9b5f0ac3b Added str() in SemanticValues. 2015-06-16 00:43:08 -04:00
yhirose
dff2db0a8e Code clean. 2015-06-16 00:30:28 -04:00
yhirose
42156c35f3 Simplefiled API. 2015-06-16 00:25:01 -04:00
yhirose
2aa60699be Simplefied code. 2015-06-15 23:26:49 -04:00
yhirose
30971d28de Simplified API. 2015-06-15 21:39:35 -04:00
yhirose
0744fa75f6 Removed parameter from enable_packrat_parsing. 2015-06-15 21:29:33 -04:00
yhirose
9765e095ab Added semantic predicate support. 2015-06-15 16:07:25 -04:00
yhirose
4eab716a6a Fixed User rule problem. 2015-06-15 13:47:59 -04:00
yhirose
553fc23853 Code clean up. 2015-06-13 01:20:33 -04:00
yhirose
c2e19cfd01 Added definition duplicates check. 2015-06-13 00:57:45 -04:00
yhirose
67de659288 Added left recursice detection. 2015-06-13 00:38:38 -04:00
yhirose
4dc334e481 Removed unused variable. 2015-06-12 21:14:10 -04:00
yhirose
ab1c426578 Code clean up. 2015-06-12 20:50:35 -04:00
yhirose
b5eec078aa Commented out the current 'predicate feature' implementation. 2015-06-12 18:57:58 -04:00
yhirose
50768de875 Added Ignore operator. 2015-06-12 18:52:26 -04:00
yhirose
46470071f3 Removed optional parameter from enable_ast(). 2015-06-12 18:12:54 -04:00
yhirose
79c6b7ce9b Fixed AST problem with And and Not predicates. 2015-06-12 15:28:10 -04:00
yhirose
341659f699 Added optimize_nodes parameter. 2015-06-12 14:09:23 -04:00
yhirose
57a3ecc620 Fixed the token detect logic. 2015-06-05 13:50:07 -04:00
yhirose
05ca1961b4 Added token check logic. 2015-06-05 13:28:38 -04:00
yhirose
37fe8bd1ff Fixed build errors. 2015-06-05 11:51:45 -04:00
yhirose
be60c69729 Renamed class name. 2015-06-05 11:45:13 -04:00
yhirose
7583711c63 Code cleanup. 2015-06-05 08:56:16 -04:00
yhirose
682417b410 Removed 'typedef Definition rule'. 2015-06-05 08:54:02 -04:00
yhirose
ab3d8b0d0e Code cleanup and fixed build error. 2015-06-04 19:06:37 -04:00
yhirose
b91efa1489 Changed the way to handle default tag in AST. 2015-06-04 14:12:09 -04:00
yhirose
a783e0addd Removed default tag value from enable_ast. 2015-06-04 13:24:22 -04:00
yhirose
e56062715a Improved AST support. 2015-06-04 11:41:14 -04:00
yhirose
f8da5085aa Refactoring. 2015-06-02 14:17:08 -04:00
yhirose
7ef79b62e2 Added set_logger. 2015-05-28 19:18:45 -04:00
yhirose
ce51b0ee98 Updated ast methods. 2015-05-28 19:03:11 -04:00
yhirose
19c3644490 Improved AST printer. 2015-05-21 18:29:36 -04:00
yhirose
561defea8b Changed to use 'size_t' for position. 2015-05-19 10:51:06 -04:00
yhirose
b8c2778e2a Working on AST feature. 2015-05-19 09:07:03 -04:00
yhirose
738fe53e39 Fixed number parsing problem. 2015-04-25 08:11:06 +09:00
yhirose
8bac879ff9 Added the predicate control feature. 2015-04-08 12:02:26 -04:00
yhirose
9546860a77 Removed unused parameter. 2015-04-08 11:07:41 -04:00
yhirose
1f48b4ca82 Improved location info of error report. 2015-04-01 13:36:03 -04:00
yhirose
26060c0f00 Fixed duplicated symbol error. 2015-03-27 15:40:50 -04:00
yhirose
59cb3b5aea Removed 'str' method from SemanticValue. 2015-03-11 14:10:23 -04:00
yhirose
e30b4a281f Name refactoring. 2015-03-09 14:58:43 -04:00
yhirose
59f350673c Improved 'map' interface on SemanticValues. 2015-03-05 22:00:18 -05:00
yhirose
81d7593ea1 Removed 'reduce' from SemanticValues. 2015-03-05 21:59:54 -05:00
yhirose
4d65fc4c56 Removed 'before/after' handlers. 2015-03-05 17:50:19 -05:00
yhirose
0fa6af3cd5 Added additional 'map' functions. 2015-03-04 18:26:11 -05:00
yhirose
fb42532c7c Removed the code to cache the user data. 2015-03-04 14:49:58 -05:00
yhirose
4e79b2de95 Added 'named capture'. Changed to cache user data. 2015-03-03 22:04:14 -05:00
yhirose
fd90882894 Improved SemanticValue interface. 2015-03-03 21:51:28 -05:00
yhirose
1fc0a6819e Updated public interface. 2015-03-02 21:52:09 -05:00
yhirose
d5e28fff94 Fixed performance problem. 2015-03-02 17:35:55 -05:00
yhirose
d93a007ef0 Moved 'choice' property to SemanticValues. 2015-02-26 22:40:00 -05:00
yhirose
7ccaf4257c Supporting the packrat parsing... 2015-02-26 21:32:26 -05:00
yhirose
a860218d4f Working on the parckrat parsing support. 2015-02-26 08:27:05 -05:00
yhirose
b19d37f052 Improving performance... 2015-02-25 19:31:00 -05:00
yhirose
4f7686cf79 Fixed problem with std::is_same. 2015-02-23 10:04:25 -05:00
yhirose
64e7274b1d Added octal/hex number support. 2015-02-22 22:23:08 -05:00
yhirose
895414a234 Added calc3.cc. (AST version) 2015-02-21 23:19:54 -05:00
yhirose
3d3af85bc7 Changed the semantic values interface. 2015-02-21 19:38:30 -05:00
yhirose
681c754302 Added 'usr' operator. 2015-02-19 22:27:47 -05:00
yhirose
42c9d06221 Code cleanup. 2015-02-19 19:51:38 -05:00
yhirose
69b82ba92b Fixed incorrect include guard string. 2015-02-19 07:54:15 -05:00
yhirose
261f8f463b Added 'const SemanticValues&` action. 2015-02-18 22:28:57 -05:00
yhirose
f87ae01d3b Removed mmap.h dependency. Close #1. 2015-02-18 21:18:20 -05:00
yhirose
f7e7e308ed Changed to allow 'mutable' lambda function as semantic action. Closed #2. 2015-02-18 19:41:18 -05:00
yhirose
9c872e2d5d Added 'ignore' operator. 2015-02-18 18:00:11 -05:00
yhirose
56daf08d5b Changed the capture operator and made the anchor operator. 2015-02-17 22:35:07 -05:00
yhirose
d2ad29359e Added 'anchor' support. Removed implecit cast operators from 'any'. 2015-02-15 20:11:02 -05:00
yhirose
81ca85cba5 Added simple interface. 2015-02-15 17:52:39 -05:00
yhirose
4c5fd70503 Removed the name vector and added the context data in semantic action. 2015-02-14 19:02:54 -05:00
yhirose
0643f44b03 Changed 'match' back to 'parse'. 2015-02-14 12:58:17 -05:00
yhirose
e6673afa0e Added bad cast check. 2015-02-14 10:20:19 -05:00
yhirose
3f639e37f0 Changed the interfaces. 2015-02-14 10:13:10 -05:00
yhirose
6e8ea2b471 Changed interface of parse in Definition. 2015-02-14 08:52:52 -05:00
yhirose
09ce72b25e Added grammar generator. 2015-02-13 22:41:17 -05:00
yhirose
5976051070 Renamed Match to Result. 2015-02-13 21:43:50 -05:00
yhirose
4282498f6c Fixed problems with peglint. 2015-02-12 22:14:28 -05:00
yhirose
f9c6a67ea6 Added simple error handling code. 2015-02-12 19:48:58 -05:00
yhirose
45024d3aaa Added error handling. 2015-02-11 23:57:00 -05:00
yhirose
97641ed257 Name refactoring. 2015-02-11 21:13:12 -05:00
yhirose
4202e6d111 Changed to allow simpler notation in actions. 2015-02-11 20:31:11 -05:00
yhirose
8acb0e2822 Changed to be able to associate actions to the prioritized choice. 2015-02-11 19:48:55 -05:00
yhirose
5a16f53a71 Fixed backtracking problem with the prioritized choice. 2015-02-09 20:13:46 -05:00
yhirose
d386f2f3b9 Major refactoring. 2015-02-09 17:12:59 -05:00
yhirose
9cb926f7a0 Work in progress. 2015-02-09 12:01:59 -05:00
yhirose
0efe8110e4 Changed to use SemanticValues instead of SemanticStack. 2015-02-08 23:02:24 -05:00
yhirose
feebade357 Added is_undefined method. 2015-02-08 23:02:10 -05:00
yhirose
1ad9e73d67 Uploaded files. 2015-02-07 20:52:26 -05:00