1/* 2 * CDDL HEADER START 3 * 4 * The contents of this file are subject to the terms of the 5 * Common Development and Distribution License (the "License"). 6 * You may not use this file except in compliance with the License. 7 * 8 * See LICENSE.txt included in this distribution for the specific 9 * language governing permissions and limitations under the License. 10 * 11 * When distributing Covered Code, include this CDDL HEADER in each 12 * file and include the License file at LICENSE.txt. 13 * If applicable, add the following below this CDDL HEADER, with the 14 * fields enclosed by brackets "[]" replaced with your own identifying 15 * information: Portions Copyright [yyyy] [name of copyright owner] 16 * 17 * CDDL HEADER END 18 */ 19 20/* 21 * Copyright (c) 2006, 2016, Oracle and/or its affiliates. All rights reserved. 22 * Portions Copyright (c) 2017, 2019, Chris Fraire <cfraire@me.com>. 23 * 24 * ##Legal Notices 25 * Microsoft and any contributors grant you a license to the Microsoft documentation and other content 26 * in this repository under the [Creative Commons Attribution 4.0 International Public License](https://creativecommons.org/licenses/by/4.0/legalcode), 27 * see the [LICENSE](LICENSE) file, and grant you a license to any code in the repository under the [MIT License](https://opensource.org/licenses/MIT), see the 28 * [LICENSE-CODE](LICENSE-CODE) file. 29 * 30 * Microsoft, Windows, Microsoft Azure and/or other Microsoft products and services referenced in the documentation 31 * may be either trademarks or registered trademarks of Microsoft in the United States and/or other countries. 32 * The licenses for this project do not grant you rights to use any Microsoft names, logos, or trademarks. 33 * Microsoft's general trademark guidelines can be found at http://go.microsoft.com/fwlink/?LinkID=254653. 34 * 35 * Privacy information can be found at https://privacy.microsoft.com/en-us/ 36 * 37 * Microsoft and any contributors reserve all others rights, whether under their respective copyrights, patents, 38 * or trademarks, whether by implication, estoppel or otherwise. 39 */ 40 41Identifier = ([a-zA-Z] [a-zA-Z0-9_]* | [_] [a-zA-Z0-9_]+) 42 43Number = [\-]? ({Numeric_integer} | {Numeric_fp} | {Hexadecimal} | {Binary} | 44 {Octal}) {Literal_type_suffix}? 45DIGIT = [0-9] 46HEXDIG = [0-9A-Fa-f] 47BINDIG = [01] 48OCTDIG = [0-7] 49 50/* 51 * "Numeric, no fractional part" 52 */ 53Numeric_integer = {DIGIT} ([_]* {DIGIT})* 54/* 55 * "Numeric, fractional part" 56 */ 57Numeric_fp = {Numeric_integer} "." {Numeric_integer} 58/* 59 * "Hexadecimal (base 16)" 60 */ 61Hexadecimal = [&][Hh] {HEXDIG} ([_]* {HEXDIG})* 62/* 63 * "Binary (base 2)" 64 */ 65Binary = [&][Bb] {BINDIG} ([_]* {BINDIG})* 66/* 67 * "Octal (base 8)" 68 */ 69Octal = [&][Oo] {OCTDIG} ([_]* {OCTDIG})* 70 71/* 72 * "Literal type character" 73 */ 74Literal_type_suffix = ([Ss] | [Ii] | [Ll] | [Dd] | [Ff] | [Rr] | [Uu][IiLlSs] | 75 [Cc] | "%" | "&" | "@" | "!" | "#" | "$") 76