Commit graph

  • 5e01cd323e Leave the RHS of a GrammarSymbolSet move default initialized main Charles Baker 2024-07-15 21:29:25 +12:00
  • 4acfde1549 Leave the RHS of a GrammarSymbolSet move default initialized Charles Baker 2024-07-15 21:29:25 +12:00
  • 4e000f92ef Add Cmake targets Ilusha 2024-03-15 11:21:01 +03:00
  • efde50b76c Fix GrammarSymbolSet's move and copy constructors elushaX 2024-06-16 06:27:29 +03:00
  • 2408821188 Fix GrammarSymbolSet's move and copy constructors elushaX 2024-06-16 06:27:29 +03:00
  • 7267c0a137 Build with Forge v0.9.7 Charles Baker 2024-07-14 16:32:46 +12:00
  • 3da6c8f8f3 Build with Forge v0.9.7 Charles Baker 2024-07-14 16:32:46 +12:00
  • e5951e9ffb Add Cmake targets Ilusha 2024-03-15 11:21:01 +03:00
  • 55ed0286df Fix GrammarSymbolSet's move and copy constructors elushaX 2024-06-16 06:27:29 +03:00
  • 2e1ef74602
    Create static.yml Domingo Alvarez Duarte 2023-11-14 16:04:21 +01:00
  • d5231dc5e7 Update code mingodad 2023-11-14 15:18:11 +01:00
  • 02946cc143 Added grammar examples mingodad 2023-11-14 15:16:26 +01:00
  • 6f73f32d39 Add code to detect user content changes and alert him/her mingodad 2023-11-14 14:58:24 +01:00
  • f5c1810a75 Add 2 new grammar options to easy debug, also fix line counting when the line end is multi character like of '\r\n' mingodad 2023-07-19 18:32:36 +02:00
  • ee28902cbe Update examples to use the extra action handler parameter recently introduced mingodad 2023-07-18 18:25:54 +02:00
  • 08939baf5b Add the reducing transition as a parameter to action handlers, this way I can generate a better parse tree. mingodad 2023-07-18 18:06:09 +02:00
  • fc40770083 Add a missing case when generating a YACC file mingodad 2023-07-18 18:02:53 +02:00
  • 208eda60fe Fix to only match fully words, because before it was matching a substring like 'error' inside 'errors' mingodad 2023-07-18 14:26:51 +02:00
  • 51ab70ed35 Add YACC generation from LALR grammars. mingodad 2023-07-17 08:45:53 +02:00
  • 8aa81d29de Fix generation of empty productions for genEBNF mingodad 2023-07-16 17:50:06 +02:00
  • 1d092219d6 Undo a mistaken removing code for a better parse tree output. mingodad 2023-07-16 14:11:18 +02:00
  • 9f907f68ca Show an error message when associativity is assigned to a non-terminal. mingodad 2023-07-16 13:54:51 +02:00
  • ccdca1a3f6 Missing fixes for a better parse tree output mingodad 2023-07-16 13:53:07 +02:00
  • eb7ff4cb9b Now I've got closer to a good parse tree dump mingodad 2023-07-16 09:55:58 +02:00
  • b20eb0bce9 FIX: Remove line from undefined symbol when whitespace is not defined playground-2023-07-16 Charles Baker 2023-07-16 18:33:48 +12:00
  • 83fad1fcca Check if the input is accepted && full before print the parse tree mingodad 2023-06-28 17:42:09 +02:00
  • c560ac4029 First implementation for outptut an parse tree. The MissingHeaders test is failing and need review. mingodad 2023-06-28 12:07:52 +02:00
  • 0835e73584 Make trivial methods inline. mingodad 2023-06-26 10:23:59 +02:00
  • 5b84882b18 Add special regex character escape for the naive case insensitive implementation mingodad 2023-06-25 09:00:17 +02:00
  • 4903fae3fe Add a naive implementation of "%case_insensitive" directive, right now it only work on literals and only for ASCII mingodad 2023-06-23 16:05:20 +02:00
  • 48c2668029 First working version of an wasm browser based playground mingodad 2023-06-23 11:53:53 +02:00
  • 4ef058bd34 Check if we are at the end and then stop mingodad 2023-06-23 11:48:36 +02:00
  • 51e711ae6b Fix examples/test that were missing '%whitespace' directive. mingodad 2023-06-23 11:15:00 +02:00
  • 90fd89ec21 Simplify GrammaSymbolSet mingodad 2023-06-23 11:12:17 +02:00
  • 3bd7c3d5e5 Use a typedef and macros to allow easy experimenting with different type to store bitfields. mingodad 2023-06-22 17:55:52 +02:00
  • 9f9dc232b4 Rename write output function to prevent clash with C lib ::write mingodad 2023-06-22 16:58:29 +02:00
  • e34ac2d567 Add a method to show grammar compilation stats. mingodad 2023-06-22 16:36:25 +02:00
  • 029862ed19 Add method to dump the input from the lexer. mingodad 2023-06-22 15:25:53 +02:00
  • 20473f0fbf Add code to allow generate an EBNF for railroad diagram generation mingodad 2023-06-22 15:19:41 +02:00
  • 20770fc410 Only check for '%whitespace' directive if the grammar has no other errors. mingodad 2023-06-23 11:13:29 +02:00
  • 1add148119 Check if '%whitespace' directive is present in the grammar and if not emit an error message. mingodad 2023-06-22 15:11:59 +02:00
  • b6321c4630 Make possible to accept associativity/precedence syntax like bison/byacc mingodad 2023-06-22 14:58:57 +02:00
  • 91bc7b48d4 Fix to detect identifiers referenced in rules but not defined mingodad 2023-06-22 14:45:30 +02:00
  • e5baa3920b Merge branch 'error-on-empty-or-unterminated-literal-or-regex' Charles Baker 2023-07-16 18:18:00 +12:00
  • 7b1a3ab372 Test errors reported for empty literals and regular expressions Charles Baker 2023-07-16 08:11:36 +12:00
  • 919b0fe36b Improve parser tests that check for errors Charles Baker 2023-07-16 15:04:13 +12:00
  • 638de559ca Report errors for unterminated regular expressions Charles Baker 2023-07-16 15:03:35 +12:00
  • b2224991c9 Advance position when encountering an unterminated literal Charles Baker 2023-07-16 08:12:50 +12:00
  • 031419b0cf Add an error message for empty literal/regex declarations, also fix to accept "'\''" literal. mingodad 2023-06-22 15:04:47 +02:00
  • 6ab3cd01d3 Escape whitespace directive correctly in lalr_calculator_example.cpp Charles Baker 2023-07-16 18:15:12 +12:00
  • eafaf02786 LINT: Remove trailing whitespace from lalr_examples.forge Charles Baker 2023-07-16 18:14:41 +12:00
  • c0b8bd0bb5 Also check for a valid parser state machine in Parser::valid() Charles Baker 2023-07-16 08:11:11 +12:00
  • 4881754402 Avoid initializing Parser with invalid ParserStateMachine Charles Baker 2023-07-16 08:10:39 +12:00
  • 4ba3456df4 Reuse result of already called function. mingodad 2023-06-22 16:33:58 +02:00
  • 7f1ea72807 Reorder class member for better memory usage/alignment. mingodad 2023-06-22 16:54:46 +02:00
  • a807827db8 Add preprocessor guards to allow build without threads/threadpool. mingodad 2023-06-22 14:48:14 +02:00
  • 3d1351c555 Add column information to errors Charles Baker 2023-07-16 15:30:41 +12:00
  • d0baae1ccd LINT: Formatting around adding columns to errors in Grammar.[ch]pp Charles Baker 2023-07-15 14:43:50 +12:00
  • eb228024db Calculate line and column inside GrammarParser::error() for simplicity Charles Baker 2023-07-15 14:48:43 +12:00
  • 29d91e8ec8 Add column info to GrammarSymbol and error messages mingodad 2023-06-26 11:01:04 +02:00
  • 16ebbc5683 Add column info to error messages in ErrorPolicy mingodad 2023-06-23 20:20:32 +02:00
  • 4aca034e26 Add 'std::' in several places as suggested by clang mingodad 2023-06-22 14:34:33 +02:00
  • be36815d67
    Merge 02178b9a7e into aeacb29cb2 Domingo Alvarez Duarte 2023-06-28 15:42:46 +00:00
  • 02178b9a7e Check if the input is accepted && full before print the parse tree mingodad 2023-06-28 17:42:09 +02:00
  • f59b70c44b First implementation for outptut an parse tree. The MissingHeaders test is failing and need review. mingodad 2023-06-28 12:07:52 +02:00
  • 3aa9a4a2e8 Add column info to GrammarSymbol and error messages mingodad 2023-06-26 11:01:04 +02:00
  • 9b72871612 Make trivial methods inline. mingodad 2023-06-26 10:23:59 +02:00
  • d9e8e15f18 Add special regex character escape for the naive case insensitive implementation mingodad 2023-06-25 09:00:17 +02:00
  • 0aec408f83 Add column info to error messages in ErrorPolicy mingodad 2023-06-23 20:20:32 +02:00
  • 41860c1570 Add a naive implementation of "%case_insensitive" directive, right now it only work on literals and only for ASCII mingodad 2023-06-23 16:05:20 +02:00
  • 4e5acced94 First working version of an wasm browser based playground mingodad 2023-06-23 11:53:53 +02:00
  • 49af659afd Check if we are at the end and then stop mingodad 2023-06-23 11:48:36 +02:00
  • deb8e3ef6c Fix examples/test that were missing '%whitespace' directive. mingodad 2023-06-23 11:15:00 +02:00
  • 06dfb8eeee Only check for '%whitespace' directive if the grammar has no other errors. mingodad 2023-06-23 11:13:29 +02:00
  • d7cacbc3d9 Simplify GrammaSymbolSet mingodad 2023-06-23 11:12:17 +02:00
  • a5387f3326 Use a typedef and macros to allow easy experimenting with different type to store bitfields. mingodad 2023-06-22 17:55:52 +02:00
  • 642de0b45c Rename write output function to prevent clash with C lib ::write mingodad 2023-06-22 16:58:29 +02:00
  • a64710d99d Reorder class member for better memory usage/alignment. mingodad 2023-06-22 16:54:46 +02:00
  • 924359539c Add a method to show grammar compilation stats. mingodad 2023-06-22 16:36:25 +02:00
  • 7a668bb247 Reuse result of already called function. mingodad 2023-06-22 16:33:58 +02:00
  • 061bf241df Add method to dump the input from the lexer. mingodad 2023-06-22 15:25:53 +02:00
  • 0e05c13844 Add code to allow generate an EBNF for railroad diagram generation mingodad 2023-06-22 15:19:41 +02:00
  • 82bfdf5b85 Check if '%whitespace' directive is present in the grammar and if not emit an error message. mingodad 2023-06-22 15:11:59 +02:00
  • 98444cb6d6 Add an error message for empty literal/regex declarations, also fix to accept "'\''" literal. mingodad 2023-06-22 15:04:47 +02:00
  • fe8da356e1 Make possible to accept associativity/precedence syntax like bison/byacc mingodad 2023-06-22 14:58:57 +02:00
  • 01e753c53d Add preprocessor guards to allow build without threads/threadpool. mingodad 2023-06-22 14:48:14 +02:00
  • 40074978ea Fix to detect identifiers referenced in rules but not defined mingodad 2023-06-22 14:45:30 +02:00
  • 163360813d Add 'std::' in several places as suggested by clang mingodad 2023-06-22 14:34:33 +02:00
  • aeacb29cb2 Fix maximum calculation in GrammarSymbolSet::insert() Charles Baker 2023-06-08 05:20:42 +12:00
  • b0a6fb6b24 Track and iterate only over set range in GrammarSymbolSet Charles Baker 2023-06-02 21:33:29 +12:00
  • b72f97e34d Use size_t for set elements in GrammarSymbolSet Charles Baker 2023-06-02 16:20:30 +12:00
  • 93160d6200 Avoid creating temporary strings adding symbols to Grammar Charles Baker 2023-06-03 10:43:27 +12:00
  • 6821f786b6 Add character encoding examples and documentation, e.g. parsing UTF-8 Charles Baker 2023-06-03 11:50:15 +12:00
  • e346baf911 Update README.md to describe parsing with different encodings Charles Baker 2023-06-03 11:37:30 +12:00
  • 071273032e Update XML example to parser from UTF-8 to UTF-8 in memory Charles Baker 2023-06-03 11:37:13 +12:00
  • 0dc846f6eb Update JSON example to parse from a UTF-8 encoded JSON file Charles Baker 2023-05-29 21:20:09 +12:00
  • d03a02d3e5 Use correct string for lexeme when debugging parsers Charles Baker 2023-05-29 21:19:24 +12:00
  • 1f85c9d00a Explicitly link with pthread on Linux Charles Baker 2023-05-28 20:49:14 +12:00
  • 3d31f45a0f Update lalr_examples/json.cpp now that arrays are parsed. Charles Baker 2023-05-28 16:22:00 +12:00
  • 9ce34162d1 Inline trivial methods in parser generator Charles Baker 2023-05-27 20:24:21 +12:00