开发者

How should I read the syntax descriptions in the JLS?

开发者 https://www.devze.com 2023-04-01 10:46 出处:网络
From the Java Language Specification (third edition), section 3.10.5: StringLiteral: \" StringCharactersopt \"

From the Java Language Specification (third edition), section 3.10.5:

StringLiteral:
        " StringCharactersopt "

StringCharacters:
        StringCharacter
        StringCharacters StringCharacter

StringCharacter:
        InputCharacter but not " or \
        EscapeSequence

Can someone please help me understand this syntax pattern? What could开发者_如何学Go xx: " xxxopt" mean?


It means a StringLiteral is a double-quote, an optional StringCharacters token, and a double quote. "opt" means optional.

StringCharacters is defined as one or more StringCharacter tokens.

StringCharacter is either an InputCharacter (defined elsewhere) except for a double-quote or a backslach; or an EscapeSequence (also defined elsewhere)

0

精彩评论

暂无评论...
验证码 换一张
取 消