Commit Graph

91 Commits

Author SHA1 Message Date
Stefano Sanfilippo 649797f13a Generating a C++ reentrant parser. 2014-11-28 19:00:51 +01:00
Stefano Sanfilippo e2a635e95f Removed redundant comment. 2014-11-28 17:22:57 +01:00
Stefano Sanfilippo 2605a5f5ff Removing generated resources from gitignore. 2014-11-28 17:19:19 +01:00
Stefano Sanfilippo 97ec6b26f2 Moving .y and .l to .ypp and .lpp 2014-11-28 17:19:09 +01:00
Stefano Sanfilippo 3facc1c9d4 Getting rid of last C leftovers. 2014-11-28 00:01:24 +01:00
Stefano Sanfilippo 84199887a7 Close all memory leaks. 2014-11-27 23:52:21 +01:00
Stefano Sanfilippo 67e5d3a4be Moving example to examples/, adding another one. 2014-11-27 22:55:08 +01:00
Stefano Sanfilippo 89f10a021f Alternate form for LT and GT operators. 2014-11-27 22:52:12 +01:00
Stefano Sanfilippo 9c728ef145 Ignoring deprecated-registers warning, since it's in generated code. 2014-11-27 22:20:03 +01:00
Stefano Sanfilippo a68467d0fd Adding -Wall to command line and fixing warnings. 2014-11-27 22:16:30 +01:00
Stefano Sanfilippo 9184c45297 Fixing pointer deref gone wild. 2014-11-27 22:16:12 +01:00
Stefano Sanfilippo d0f3d30643 Fixing two NPEs in case of missing else and missing main. 2014-11-27 22:10:10 +01:00
Stefano Sanfilippo 764e21abd6 Removing C leftovers. 2014-11-27 21:56:48 +01:00
Stefano Sanfilippo fda1ae54bc Shorter prefix for parser pseudonamespace. 2014-11-27 21:55:40 +01:00
Stefano Sanfilippo ce513643da Strongly typed enum for type tokens. 2014-11-27 21:53:25 +01:00
Stefano Sanfilippo 76ee587672 Use std::unique_ptr whenever possible. 2014-11-27 21:51:20 +01:00
Stefano Sanfilippo 9b32c4e4d4 Fixing global variable that was not caught in prefix renaming. 2014-11-27 21:50:40 +01:00
Stefano Sanfilippo 60136fc4e9 Minor cleanups to lexer. 2014-11-27 21:34:26 +01:00
Stefano Sanfilippo 88e78be419 Fixing swapped GTE and LTE. 2014-11-27 21:30:42 +01:00
Stefano Sanfilippo 13ccc9277e Alternate spelling for LTE and GTE operators. 2014-11-27 21:30:29 +01:00
Stefano Sanfilippo 5573307305 Removing redundant ; 2014-11-27 21:20:50 +01:00
Stefano Sanfilippo 1ff2a2dd24 Add flex output files to gitignore. 2014-11-27 20:52:44 +01:00
Stefano Sanfilippo beab3a1512 Removing debug flag from Makefile. 2014-11-27 20:50:51 +01:00
Stefano Sanfilippo 7e9bc1a55e Adding required headers on top of file. 2014-11-27 20:43:25 +01:00
Stefano Sanfilippo c326de1131 Blank line after function definition. 2014-11-27 20:43:09 +01:00
Stefano Sanfilippo ae7c1f98d9 Optionally read and write to file. 2014-11-27 20:42:55 +01:00
Stefano Sanfilippo 12c5043778 Adding namespace declaration to lexer. 2014-11-27 20:02:15 +01:00
Stefano Sanfilippo 747bc16a85 Plugging AST nodes into semantic rules. 2014-11-27 20:01:52 +01:00
Stefano Sanfilippo e65896f2c5 Updating Makefile. 2014-11-27 20:01:40 +01:00
Stefano Sanfilippo 37141d1e7a Implementing AST nodes. 2014-11-27 20:01:06 +01:00
Stefano Sanfilippo a886ada349 main() should return 0, not void. 2014-11-27 20:00:19 +01:00
Stefano Sanfilippo 40845c011b Cleanups.
1. move emit() to separate file.
2. move main to .cpp
3. use "namespace" for parser and lexer.
4. remove Type.h
2014-11-27 19:59:48 +01:00
Stefano Sanfilippo c9b53a7470 Removing unnecessary commas from examples. 2014-11-25 00:57:18 +01:00
Stefano Sanfilippo 9e12a95612 Renaming ASSERT_BEGIN and ASSERT_END into ASSERT and BANG. 2014-11-25 00:47:51 +01:00
Stefano Sanfilippo 4cdde5025a Fully optional comma.
As a side effect, return now must end with "!".
2014-11-25 00:46:34 +01:00
Stefano Sanfilippo ab0cd1f1de Funnier function declaration. 2014-11-25 00:39:42 +01:00
Stefano Sanfilippo 90c75e9b5a Optional statement terminator wherever possibile. 2014-11-25 00:39:27 +01:00
Stefano Sanfilippo 7197bd707a Allow arbitrary expressions to be passed as function params. 2014-11-25 00:39:01 +01:00
Stefano Sanfilippo be3de046c3 Moving %start directive to bottom of prologue. 2014-11-24 23:59:28 +01:00
Stefano Sanfilippo b5d524c295 Add Types.h to %code require in parser definition. 2014-11-24 23:56:54 +01:00
Stefano Sanfilippo aa122fd7a0 Add auxiliary macro _() 2014-11-24 23:53:26 +01:00
Stefano Sanfilippo af934dfea8 Formatting 2014-11-24 21:19:13 +01:00
Stefano Sanfilippo 2f42a60849 Prototypes and header cleanups for parser. 2014-11-24 21:18:59 +01:00
Stefano Sanfilippo adb1c82e7c Fix code formatting in example. 2014-11-24 13:51:53 +01:00
Stefano Sanfilippo a15da1f544 Best fit for BRANCH_ELSE. 2014-11-24 10:54:25 +01:00
Stefano Sanfilippo e40f1cf55f More compact format for beautified example. 2014-11-24 10:52:56 +01:00
Stefano Sanfilippo 65a3929f48 CASE_END only if case is not last. 2014-11-24 10:50:10 +01:00
Stefano Sanfilippo 16772f287e Cluster common part between expression and semi-expression. 2014-11-24 00:14:27 +01:00
Stefano Sanfilippo b35d565ec6 Add contracted article forms. 2014-11-23 23:46:32 +01:00
Stefano Sanfilippo d80705b163 Allow ARTICLE in function param list. 2014-11-23 23:45:29 +01:00