Skip to content

Commit

Permalink
Merge commit 'a981be8de45cb30643a06d04b52b483f8982e06f' into parallel
Browse files Browse the repository at this point in the history
  • Loading branch information
mlaveaux committed Jun 27, 2022
1 parent 78d0f34 commit 39195f7
Show file tree
Hide file tree
Showing 101 changed files with 8,658 additions and 6,665 deletions.
6 changes: 6 additions & 0 deletions 3rd-party/dparser/CHANGES
Original file line number Diff line number Diff line change
@@ -1,3 +1,9 @@
1.32 Fixed bugs with priorities.

1.29 Fixed bug with handling of priorities and associativity (thanx Sjoerd Cranen)
Fixed a bug in error recovery.
Fixed a slash escapes in string literals (thanx Sjoerd Cranen)

1.28 Fixed bug with actions containing commments containing '
Python 2.6+ support, thanx to [email protected]

Expand Down
26 changes: 14 additions & 12 deletions 3rd-party/dparser/CMakeLists.txt
Original file line number Diff line number Diff line change
Expand Up @@ -30,29 +30,31 @@ add_definitions(
)
endif(MSVC AND MSVC_VERSION LESS 1900)

add_library(dparser STATIC
arg.c
parse.c
scan.c
symtab.c
util.c
read_binary.c
dparse_tree.c
)

add_executable(make_dparser
make_dparser.c
version.c
)

add_library(mkdparse STATIC
mkdparse.c
write_tables.c
grammar.g.c
gram.c
lex.c
lr.c
version.c
)

target_link_libraries(make_dparser
dparser
add_library(dparser STATIC
arg.c
parse.c
scan.c
dsymtab.c
util.c
read_binary.c
dparse_tree.c
)

target_link_libraries(make_dparser PRIVATE mkdparse dparser)

set(dparser_include ${CMAKE_CURRENT_SOURCE_DIR} PARENT_SCOPE)
9 changes: 0 additions & 9 deletions 3rd-party/dparser/COPYRIGHT

This file was deleted.

29 changes: 29 additions & 0 deletions 3rd-party/dparser/LICENSE.txt
Original file line number Diff line number Diff line change
@@ -0,0 +1,29 @@
BSD 3-Clause License

Copyright (c) 1994-2020, John Bradley Plevyak
All rights reserved.

Redistribution and use in source and binary forms, with or without
modification, are permitted provided that the following conditions are met:

1. Redistributions of source code must retain the above copyright notice, this
list of conditions and the following disclaimer.

2. Redistributions in binary form must reproduce the above copyright notice,
this list of conditions and the following disclaimer in the documentation
and/or other materials provided with the distribution.

3. Neither the name of the copyright holder nor the names of its
contributors may be used to endorse or promote products derived from
this software without specific prior written permission.

THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS"
AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE
IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE
DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT HOLDER OR CONTRIBUTORS BE LIABLE
FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL
DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR
SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER
CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY,
OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE
OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
16 changes: 0 additions & 16 deletions 3rd-party/dparser/README

This file was deleted.

4 changes: 0 additions & 4 deletions 3rd-party/dparser/README.1ST

This file was deleted.

84 changes: 84 additions & 0 deletions 3rd-party/dparser/README.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,84 @@
# DParser
###### (you know... 'da parser)


## Introduction

`DParser` is a simple but powerful tool for parsing. You
can specify the form of the text to be parsed using a combination of
regular expressions and grammar productions. Because of the
parsing technique (technically a scannerless GLR parser based on the
Tomita algorithm) there are no restrictions. The grammar can be
ambiguous, right or left recursive, have any number of null
productions,
and because there is no separate tokenizer, can include whitespace in
terminals and have terminals which are prefixes of other terminals.
`DParser` handles not just well formed computer languages and data
files, but just about any wacky situation that occurs in the real world.
The result is natural grammars and powerful parsing.


## Features

* Powerful GLR parsing
* Simple EBNF-style grammars and regular expression terminals
* State-specific symbol table
* Priorities and associativities for token and rules
* Built-in error recovery
* Can be compiled to work with or without the Boehm garbage collector
* Speculative actions (for semantic disambiguation)
* Auto-building of parse tree (optionally)
* Final actions as you go, or on the complete parse tree
* Tree walkers and default actions (multi-pass compilation support)
* Symbol table built for ambiguous parsing
* Partial parses, recursive parsing, parsing starting with any non-terminal
* Whitespace can be specified as a subgrammar
* External (C call interface) tokenizers and terminal scanners
* Good asymptotic efficiency
* Comes with ANSI-C, Python and Verilog grammars
* Comes with full source
* Portable C for easy compilation and linking
* BSD licence, so you can include it in your application without worrying about licensing


## Example Grammars

* [ANSI-C](ansic/ansic.g)
* [Python](tests/python.test.g)
* [Verilog](verilog/verilog.g)


## Documentation
* [Man page for parser generator](make_dparser.cat)
* [Manual](docs/manual.md)
* [FAQ](docs/faq.md)


## Public Headers

* [dparse.h](dparse.h) - main parser data structures and functions
* [dparse_tables.h](dparse_tables.h) - parse tables data structures
* [dsymtab.h](dsymtab.h) - optional symbol table


## Building

* To build: `gmake` -- only available with source code package
* To test: `gmake test` -- only available with source code package
* To install: `gmake install` -- binary or source code packages

For python support: `cd python; gmake install`


## Makefile Options

* `D_USE_GC`: set to 1 to use the Boehm garbage collector
* `D_DEBUG`: set to 1 to compile with debugging support (`-g`)
* `D_OPTIMIZE`: set to 1 to compile with optimizations (`-O3`)
* `D_PROFILE`: set to 1 to compile with profiling support (`-pg`)
* `D_LEAK_DETECT`: set to 1 to compile with memory leak detection (`-lleak`)
* `D_USE_FREELISTS`: set to 1 to use free lists instead of straign free/malloc (defaults to 1)


## Contact
Contact the author: `jplevyak` `at` `gmail`
Loading

0 comments on commit 39195f7

Please sign in to comment.