%%%
 %% Section 3.10.5: String Literals
 %%
 %% @author Martin Bravenboer <martin@cs.uu.nl>
 %%%
module languages/java-14/lexical/literals/StringLiterals
imports
  languages/java-14/lexical/literals/EscapeSequences
  languages/java-14/lexical/UnicodeEscapes

exports
  sorts
    StringLiteral
    StringPart
    StringChars
    FooStringChars

  syntax
    StringLiteral -> <StringLiteral-CF>
    
    "\"" StringPart* "\"" -> StringLiteral {cons("String")}
    StringChars    -> StringPart {cons("Chars")}
    UnicodeEscape  -> StringPart
    EscapeSeq      -> StringPart

    <FooStringChars-LEX> -> StringChars
    ~[\"\\\n\13]+  -> <FooStringChars-LEX>

  restrictions
    StringChars -/- ~[\"\\\n\13]
