@@ -1856,3 +1856,162 @@ module Blame {
18561856 final override string getAPrimaryQlClass ( ) { result = "Number" }
18571857 }
18581858}
1859+
1860+ module JSON {
1861+ /** The base class for all AST nodes */
1862+ class AstNode extends @json_ast_node {
1863+ /** Gets a string representation of this element. */
1864+ string toString ( ) { result = this .getAPrimaryQlClass ( ) }
1865+
1866+ /** Gets the location of this element. */
1867+ final L:: Location getLocation ( ) { json_ast_node_info ( this , _, _, result ) }
1868+
1869+ /** Gets the parent of this element. */
1870+ final AstNode getParent ( ) { json_ast_node_info ( this , result , _, _) }
1871+
1872+ /** Gets the index of this node among the children of its parent. */
1873+ final int getParentIndex ( ) { json_ast_node_info ( this , _, result , _) }
1874+
1875+ /** Gets a field or child node of this node. */
1876+ AstNode getAFieldOrChild ( ) { none ( ) }
1877+
1878+ /** Gets the name of the primary QL class for this element. */
1879+ string getAPrimaryQlClass ( ) { result = "???" }
1880+
1881+ /** Gets a comma-separated list of the names of the primary CodeQL classes to which this element belongs. */
1882+ string getPrimaryQlClasses ( ) { result = concat ( this .getAPrimaryQlClass ( ) , "," ) }
1883+ }
1884+
1885+ /** A token. */
1886+ class Token extends @json_token, AstNode {
1887+ /** Gets the value of this token. */
1888+ final string getValue ( ) { json_tokeninfo ( this , _, result ) }
1889+
1890+ /** Gets a string representation of this element. */
1891+ final override string toString ( ) { result = this .getValue ( ) }
1892+
1893+ /** Gets the name of the primary QL class for this element. */
1894+ override string getAPrimaryQlClass ( ) { result = "Token" }
1895+ }
1896+
1897+ /** A reserved word. */
1898+ class ReservedWord extends @json_reserved_word, Token {
1899+ /** Gets the name of the primary QL class for this element. */
1900+ final override string getAPrimaryQlClass ( ) { result = "ReservedWord" }
1901+ }
1902+
1903+ /** A class representing `array` nodes. */
1904+ class Array extends @json_array, AstNode {
1905+ /** Gets the name of the primary QL class for this element. */
1906+ final override string getAPrimaryQlClass ( ) { result = "Array" }
1907+
1908+ /** Gets the `i`th child of this node. */
1909+ final Value getChild ( int i ) { json_array_child ( this , i , result ) }
1910+
1911+ /** Gets a field or child node of this node. */
1912+ final override AstNode getAFieldOrChild ( ) { json_array_child ( this , _, result ) }
1913+ }
1914+
1915+ /** A class representing `comment` tokens. */
1916+ class Comment extends @json_token_comment, Token {
1917+ /** Gets the name of the primary QL class for this element. */
1918+ final override string getAPrimaryQlClass ( ) { result = "Comment" }
1919+ }
1920+
1921+ /** A class representing `document` nodes. */
1922+ class Document extends @json_document, AstNode {
1923+ /** Gets the name of the primary QL class for this element. */
1924+ final override string getAPrimaryQlClass ( ) { result = "Document" }
1925+
1926+ /** Gets the `i`th child of this node. */
1927+ final Value getChild ( int i ) { json_document_child ( this , i , result ) }
1928+
1929+ /** Gets a field or child node of this node. */
1930+ final override AstNode getAFieldOrChild ( ) { json_document_child ( this , _, result ) }
1931+ }
1932+
1933+ /** A class representing `escape_sequence` tokens. */
1934+ class EscapeSequence extends @json_token_escape_sequence, Token {
1935+ /** Gets the name of the primary QL class for this element. */
1936+ final override string getAPrimaryQlClass ( ) { result = "EscapeSequence" }
1937+ }
1938+
1939+ /** A class representing `false` tokens. */
1940+ class False extends @json_token_false, Token {
1941+ /** Gets the name of the primary QL class for this element. */
1942+ final override string getAPrimaryQlClass ( ) { result = "False" }
1943+ }
1944+
1945+ /** A class representing `null` tokens. */
1946+ class Null extends @json_token_null, Token {
1947+ /** Gets the name of the primary QL class for this element. */
1948+ final override string getAPrimaryQlClass ( ) { result = "Null" }
1949+ }
1950+
1951+ /** A class representing `number` tokens. */
1952+ class Number extends @json_token_number, Token {
1953+ /** Gets the name of the primary QL class for this element. */
1954+ final override string getAPrimaryQlClass ( ) { result = "Number" }
1955+ }
1956+
1957+ /** A class representing `object` nodes. */
1958+ class Object extends @json_object, AstNode {
1959+ /** Gets the name of the primary QL class for this element. */
1960+ final override string getAPrimaryQlClass ( ) { result = "Object" }
1961+
1962+ /** Gets the `i`th child of this node. */
1963+ final Pair getChild ( int i ) { json_object_child ( this , i , result ) }
1964+
1965+ /** Gets a field or child node of this node. */
1966+ final override AstNode getAFieldOrChild ( ) { json_object_child ( this , _, result ) }
1967+ }
1968+
1969+ /** A class representing `pair` nodes. */
1970+ class Pair extends @json_pair, AstNode {
1971+ /** Gets the name of the primary QL class for this element. */
1972+ final override string getAPrimaryQlClass ( ) { result = "Pair" }
1973+
1974+ /** Gets the node corresponding to the field `key`. */
1975+ final AstNode getKey ( ) { json_pair_def ( this , result , _) }
1976+
1977+ /** Gets the node corresponding to the field `value`. */
1978+ final Value getValue ( ) { json_pair_def ( this , _, result ) }
1979+
1980+ /** Gets a field or child node of this node. */
1981+ final override AstNode getAFieldOrChild ( ) {
1982+ json_pair_def ( this , result , _) or json_pair_def ( this , _, result )
1983+ }
1984+ }
1985+
1986+ /** A class representing `string` nodes. */
1987+ class String extends @json_string__, AstNode {
1988+ /** Gets the name of the primary QL class for this element. */
1989+ final override string getAPrimaryQlClass ( ) { result = "String" }
1990+
1991+ /** Gets the child of this node. */
1992+ final StringContent getChild ( ) { json_string_child ( this , result ) }
1993+
1994+ /** Gets a field or child node of this node. */
1995+ final override AstNode getAFieldOrChild ( ) { json_string_child ( this , result ) }
1996+ }
1997+
1998+ /** A class representing `string_content` nodes. */
1999+ class StringContent extends @json_string_content, AstNode {
2000+ /** Gets the name of the primary QL class for this element. */
2001+ final override string getAPrimaryQlClass ( ) { result = "StringContent" }
2002+
2003+ /** Gets the `i`th child of this node. */
2004+ final EscapeSequence getChild ( int i ) { json_string_content_child ( this , i , result ) }
2005+
2006+ /** Gets a field or child node of this node. */
2007+ final override AstNode getAFieldOrChild ( ) { json_string_content_child ( this , _, result ) }
2008+ }
2009+
2010+ /** A class representing `true` tokens. */
2011+ class True extends @json_token_true, Token {
2012+ /** Gets the name of the primary QL class for this element. */
2013+ final override string getAPrimaryQlClass ( ) { result = "True" }
2014+ }
2015+
2016+ class Value extends @json_value, AstNode { }
2017+ }
0 commit comments