2 * Copyright (c) 2016, Facebook, Inc.
5 * This source code is licensed under the BSD-style license found in the
6 * LICENSE file in the "hack" directory of this source tree. An additional
7 * grant of patent rights can be found in the PATENTS file in the same
12 * THIS FILE IS @generated; DO NOT EDIT IT
13 * To regenerate this file, run
15 * buck run //hphp/hack/src:generate_full_fidelity
17 * This module contains the type describing the structure of a syntax tree.
26 (* Given text tokens *)
142 | LessThanGreaterThan
143 | LessThanEqualGreaterThan
145 | GreaterThanGreaterThan
153 | ExclamationEqualEqual
171 | LessThanLessThanEqual
172 | GreaterThanGreaterThanEqual
180 | EqualEqualGreaterThan
181 | QuestionMinusGreaterThan
189 | QuestionGreaterThan
190 (* Variable text tokens *)
202 | SingleQuotedStringLiteral
203 | DoubleQuotedStringLiteral
204 | DoubleQuotedStringLiteralHead
206 | DoubleQuotedStringLiteralTail
207 | HeredocStringLiteral
208 | HeredocStringLiteralHead
209 | HeredocStringLiteralTail
210 | NowdocStringLiteral
221 let from_string keyword
=
223 | "true" -> Some BooleanLiteral
224 | "false" -> Some BooleanLiteral
225 | "abstract" -> Some Abstract
227 | "array" -> Some Array
228 | "arraykey" -> Some Arraykey
230 | "async" -> Some Async
231 | "attribute" -> Some Attribute
232 | "await" -> Some Await
233 | "bool" -> Some Bool
234 | "break" -> Some Break
235 | "case" -> Some Case
236 | "catch" -> Some Catch
237 | "category" -> Some Category
238 | "children" -> Some Children
239 | "class" -> Some Class
240 | "classname" -> Some Classname
241 | "clone" -> Some Clone
242 | "const" -> Some Const
243 | "__construct" -> Some Construct
244 | "continue" -> Some Continue
245 | "coroutine" -> Some Coroutine
246 | "darray" -> Some Darray
247 | "default" -> Some Default
248 | "define" -> Some Define
249 | "__destruct" -> Some Destruct
250 | "dict" -> Some Dict
252 | "double" -> Some Double
253 | "echo" -> Some Echo
254 | "else" -> Some Else
255 | "elseif" -> Some Elseif
256 | "empty" -> Some Empty
257 | "enum" -> Some Enum
258 | "eval" -> Some Eval
259 | "extends" -> Some Extends
260 | "fallthrough" -> Some Fallthrough
261 | "float" -> Some Float
262 | "final" -> Some Final
263 | "finally" -> Some Finally
265 | "foreach" -> Some Foreach
266 | "function" -> Some Function
267 | "global" -> Some Global
268 | "goto" -> Some Goto
270 | "implements" -> Some Implements
271 | "include" -> Some Include
272 | "include_once" -> Some Include_once
273 | "instanceof" -> Some Instanceof
274 | "insteadof" -> Some Insteadof
276 | "interface" -> Some Interface
277 | "isset" -> Some Isset
278 | "keyset" -> Some Keyset
279 | "list" -> Some List
280 | "mixed" -> Some Mixed
281 | "namespace" -> Some Namespace
283 | "newtype" -> Some Newtype
284 | "noreturn" -> Some Noreturn
286 | "object" -> Some Object
288 | "parent" -> Some Parent
289 | "print" -> Some Print
290 | "private" -> Some Private
291 | "protected" -> Some Protected
292 | "public" -> Some Public
293 | "require" -> Some Require
294 | "require_once" -> Some Require_once
295 | "required" -> Some Required
296 | "resource" -> Some Resource
297 | "return" -> Some Return
298 | "self" -> Some Self
299 | "shape" -> Some Shape
300 | "static" -> Some Static
301 | "string" -> Some String
302 | "super" -> Some Super
303 | "suspend" -> Some Suspend
304 | "switch" -> Some Switch
305 | "this" -> Some This
306 | "throw" -> Some Throw
307 | "trait" -> Some Trait
309 | "tuple" -> Some Tuple
310 | "type" -> Some Type
311 | "unset" -> Some Unset
314 | "varray" -> Some Varray
316 | "void" -> Some Void
317 | "where" -> Some Where
318 | "while" -> Some While
320 | "yield" -> Some Yield
321 | "[" -> Some LeftBracket
322 | "]" -> Some RightBracket
323 | "(" -> Some LeftParen
324 | ")" -> Some RightParen
325 | "{" -> Some LeftBrace
326 | "}" -> Some RightBrace
328 | "->" -> Some MinusGreaterThan
329 | "++" -> Some PlusPlus
330 | "--" -> Some MinusMinus
331 | "**" -> Some StarStar
336 | "!" -> Some Exclamation
339 | "%" -> Some Percent
340 | "<>" -> Some LessThanGreaterThan
341 | "<=>" -> Some LessThanEqualGreaterThan
342 | "<<" -> Some LessThanLessThan
343 | ">>" -> Some GreaterThanGreaterThan
344 | "<" -> Some LessThan
345 | ">" -> Some GreaterThan
346 | "<=" -> Some LessThanEqual
347 | ">=" -> Some GreaterThanEqual
348 | "==" -> Some EqualEqual
349 | "===" -> Some EqualEqualEqual
350 | "!=" -> Some ExclamationEqual
351 | "!==" -> Some ExclamationEqualEqual
354 | "&" -> Some Ampersand
355 | "&&" -> Some AmpersandAmpersand
356 | "||" -> Some BarBar
357 | "?" -> Some Question
358 | "??" -> Some QuestionQuestion
360 | ";" -> Some Semicolon
362 | "**=" -> Some StarStarEqual
363 | "*=" -> Some StarEqual
364 | "/=" -> Some SlashEqual
365 | "%=" -> Some PercentEqual
366 | "+=" -> Some PlusEqual
367 | "-=" -> Some MinusEqual
368 | ".=" -> Some DotEqual
369 | "<<=" -> Some LessThanLessThanEqual
370 | ">>=" -> Some GreaterThanGreaterThanEqual
371 | "&=" -> Some AmpersandEqual
372 | "^=" -> Some CaratEqual
373 | "|=" -> Some BarEqual
376 | "::" -> Some ColonColon
377 | "=>" -> Some EqualGreaterThan
378 | "==>" -> Some EqualEqualGreaterThan
379 | "?->" -> Some QuestionMinusGreaterThan
380 | "..." -> Some DotDotDot
381 | "$$" -> Some DollarDollar
382 | "|>" -> Some BarGreaterThan
383 | "null" -> Some NullLiteral
384 | "/>" -> Some SlashGreaterThan
385 | "</" -> Some LessThanSlash
386 | "<?" -> Some LessThanQuestion
387 | "?>" -> Some QuestionGreaterThan
393 | EndOfFile
-> "end_of_file"
394 (* Given text tokens *)
395 | Abstract
-> "abstract"
398 | Arraykey
-> "arraykey"
401 | Attribute
-> "attribute"
407 | Category
-> "category"
408 | Children
-> "children"
410 | Classname
-> "classname"
413 | Construct
-> "__construct"
414 | Continue
-> "continue"
415 | Coroutine
-> "coroutine"
417 | Default
-> "default"
419 | Destruct
-> "__destruct"
429 | Extends
-> "extends"
430 | Fallthrough
-> "fallthrough"
433 | Finally
-> "finally"
435 | Foreach
-> "foreach"
436 | Function
-> "function"
440 | Implements
-> "implements"
441 | Include
-> "include"
442 | Include_once
-> "include_once"
443 | Instanceof
-> "instanceof"
444 | Insteadof
-> "insteadof"
446 | Interface
-> "interface"
451 | Namespace
-> "namespace"
453 | Newtype
-> "newtype"
454 | Noreturn
-> "noreturn"
460 | Private
-> "private"
461 | Protected
-> "protected"
463 | Require
-> "require"
464 | Require_once
-> "require_once"
465 | Required
-> "required"
466 | Resource
-> "resource"
473 | Suspend
-> "suspend"
492 | RightBracket
-> "]"
498 | MinusGreaterThan
-> "->"
510 | LessThanGreaterThan
-> "<>"
511 | LessThanEqualGreaterThan
-> "<=>"
512 | LessThanLessThan
-> "<<"
513 | GreaterThanGreaterThan
-> ">>"
516 | LessThanEqual
-> "<="
517 | GreaterThanEqual
-> ">="
519 | EqualEqualEqual
-> "==="
520 | ExclamationEqual
-> "!="
521 | ExclamationEqualEqual
-> "!=="
525 | AmpersandAmpersand
-> "&&"
528 | QuestionQuestion
-> "??"
532 | StarStarEqual
-> "**="
535 | PercentEqual
-> "%="
539 | LessThanLessThanEqual
-> "<<="
540 | GreaterThanGreaterThanEqual
-> ">>="
541 | AmpersandEqual
-> "&="
547 | EqualGreaterThan
-> "=>"
548 | EqualEqualGreaterThan
-> "==>"
549 | QuestionMinusGreaterThan
-> "?->"
551 | DollarDollar
-> "$$"
552 | BarGreaterThan
-> "|>"
553 | NullLiteral
-> "null"
554 | SlashGreaterThan
-> "/>"
555 | LessThanSlash
-> "</"
556 | LessThanQuestion
-> "<?"
557 | QuestionGreaterThan
-> "?>"
558 (* Variable text tokens *)
559 | ErrorToken
-> "error_token"
561 | QualifiedName
-> "qualified_name"
562 | Variable
-> "variable"
563 | NamespacePrefix
-> "namespace_prefix"
564 | DecimalLiteral
-> "decimal_literal"
565 | OctalLiteral
-> "octal_literal"
566 | HexadecimalLiteral
-> "hexadecimal_literal"
567 | BinaryLiteral
-> "binary_literal"
568 | FloatingLiteral
-> "floating_literal"
569 | ExecutionString
-> "execution_string"
570 | SingleQuotedStringLiteral
-> "single_quoted_string_literal"
571 | DoubleQuotedStringLiteral
-> "double_quoted_string_literal"
572 | DoubleQuotedStringLiteralHead
-> "double_quoted_string_literal_head"
573 | StringLiteralBody
-> "string_literal_body"
574 | DoubleQuotedStringLiteralTail
-> "double_quoted_string_literal_tail"
575 | HeredocStringLiteral
-> "heredoc_string_literal"
576 | HeredocStringLiteralHead
-> "heredoc_string_literal_head"
577 | HeredocStringLiteralTail
-> "heredoc_string_literal_tail"
578 | NowdocStringLiteral
-> "nowdoc_string_literal"
579 | BooleanLiteral
-> "boolean_literal"
580 | XHPCategoryName
-> "XHP_category_name"
581 | XHPElementName
-> "XHP_element_name"
582 | XHPClassName
-> "XHP_class_name"
583 | XHPStringLiteral
-> "XHP_string_literal"
584 | XHPBody
-> "XHP_body"
585 | XHPComment
-> "XHP_comment"