module C-Identifiers
imports C-Keywords

exports
  sorts ID
  lexical syntax
    [a-zA-Z\_] [a-zA-Z\_0-9]* -> ID

    Keyword -> ID {reject}

  lexical restrictions
    ID -/- [a-zA-Z\_0-9]

  sorts IDENTIFIER
  context-free syntax
    ID          -> IDENTIFIER {cons("Id")}
    ID          -> TypedefName {cons("TypeId"), avoid}
    IDENTIFIER  -> IdOrTypedefName
    TypedefName -> IdOrTypedefName

