Skip to content

ompparser APIs #83

Open
Open
@yanyh15

Description

We need two internal global variables for language: user_set_lang for storing user-specified language, auto_lang for storing parser detected language. Our only report errors that are incompatible.

Now we have three APIs:

  1. setLang: set the user_set_lang variable to the language user wants to parse in the future call to parseOpenMP

  2. getLang: return the value of the user_set_lang variable

  3. parseOpenMP: check the language for the string to be parsed (we can only detect C/C++ and Fortran, we cannot differentiate C and C++), if it is not compatible (C and C++ are compatible) with the user_set_lang that is already set, report error and return. If user_set_lang is not set, parser will use the detected language (stored in auto_lang variable) for the parsing and set the directive->lang field. In this case, auto_lang will be set at begining as Lang_C and then will be reset as Lang_C++. The directive->lang will be either user_set_lang or the detected 'auto_lang'.

For linear clause, detecting language needs to be done at the beginning for C/Fortran and then in the middle of parsing as well since only some modifier are allowed for C++. So if C++ modifier is parsed, parser needs to set auto_lang to C++ if the current auto_lang is not lang_fortran, parser also needs to check whether user_set_langis set and if so, compare it withauto_lang`.

A macro for checking whether detected language matches user-specified language.

#define lang_not_match ( ) (user_set_lang != Lang_unknown && user_set_lang != auto_lang) 

Activity

added a commit that references this issue on Nov 22, 2019
added a commit that references this issue on Nov 26, 2019

Merge pull request #85 from passlab/xinyao

3ef47d4
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions

      ompparser APIs · Issue #83 · passlab/ompparser