Skip to content

OpenMP Syntax Checking #52

@yanyh15

Description

@yanyh15

OpenMP has lots of restrictions and rules in each directive and clause. A full syntax checking requires detailed work for each directive and clause. I am proposing that we apply the following strategies:

  1. If we can use the lexer and grammar rules to apply restrictions and rules that are straightforward, we will use lexer and grammar rules
  2. For more complicated checking that involve only one clause type, e.g. syntax checking can be performed when adding the clause information to the directive object. E.g. single-use restriction for if, num_threads, ... clauses can be checked when adding the clause.
  3. For those checking that needs to involve multiple clauses and can only be performed after the whole directive is parsed, we will need to do that after parsing the whole directive. E.g. the use of if and other clauses in the combined directive, a clause that must exist for a directive.
  4. Syntax checking that involves language-specific expression and identifiers are very limited due to the nature of the parser. The simple checking can be done is to check whether two variables are used in two places that are conflict, e.g. shared(avar) private(avar). This is incorrect use of avar and can be checked by simply comparing the strings of the occurence of the variable.
  5. Full semantics checking should be done by the integrating compiler

Metadata

Metadata

Labels

Type

No type

Projects

No projects

Milestone

No milestone

Relationships

None yet

Development

No branches or pull requests

Issue actions