ompparser is a standalone and unified OpenMP parser for both C/C++ and Fortran. It can be used as an independent tool as well as an integral component of an OpenMP compiler. It has syntax and semantics checking functionalitity for OpenMP constructs for validating and verifying usage of existing constructs. The formal grammar included in ompparser, developed with Flex and Bison tools, can help interpretation of the OpenMP standard. The implementation supports the full and latest OpenMP 5.0 and is released as open-source with BSD-license.
-
clone the repo, create build folder and use cmake to create Makefile
git clone https://github.com/passlab/ompparser.git mkdir ompparser-build cd ompparser-build cmake -DCMAKE_INSTALL_PREFIX=../ompparser-install ../ompparser
-
build and install
make; make install
enum OpenMPBaseLang {
Lang_C,
Lang_Cplusplus,
Lang_Fortran,
Lang_unknown
};
class OpenMPClause : public SourceLocation {
...
}
class OpenMPDirective : public SourceLocation {
...
}
extern OpenMPDirective * parseOpenMP(const char *, void * exprParse(const char * expr));
- Full OpenMP 5.0 standard support for both C/C++ and Fortran, including parsing and unparsing
- Flex lexer rules and Bison grammars for OpenMP 5.0 syntax
- Intermediate representation of OpenMP constructs
- Easy-to-use interface to parse OpenMP constructs and to emit OpenMP intermediate representation
- Syntax checking in grammar, OpenMP parsing and IR construction, and post-parsing
- Clause normalization, e.g. combining multiple shared clauses into one shared clause
- Limited semantics checking when a construct use C/C++/Fortran identifiers or expressions
- Testing driver and test cases for extensive testing of OpenMP constructs (ongoing work)
- DOT graph output of OpenMP constructs (ongoing work)
- Conversion between perfectly-nested OpenMP constructs and combined constructs (ongoing work)
- Being integrated with ROSE compiler (ongoing work)
Submit contribution as github pull request to this repository. We require all new contributions must be made with the similar license.
Submit feature request, bugs and questions from the repository's "Issues" tab.
The work has been performed with support from Department of Energy Lawrence Livermore National Laboratory and the National Science Foundation. To cite, please use following paper:
Anjia Wang, Yaying Shi, Xinyao Yi, Yonghong Yan, Chunhua Liao and Bronis R. de Supinski, ompparser: A Standalone and Unified OpenMP Parser, the 15th International Workshop on OpenMP (IWOMP), 11th - 13th September, in Auckland, New Zealand. The presentation of the paper, which is from IWOMP'19 website.
Anjia Wang, Yaying Shi, Xinyao Yi, Yonghong Yan, Chunhua Liao and Bronis R. de Supinski
Please contact Yonghong Yan (@yanyh15) from github or gmail.
ompparser is released under a BSD license. For more details see the file LICENSE.
LLNL-CODE-798101