Update generator

This commit is contained in:
Taus
2022-07-22 13:02:40 +00:00
committed by erik-krogh
parent 495576c438
commit 395414c3cf
5 changed files with 743 additions and 4 deletions

BIN
ql/Cargo.lock generated

Binary file not shown.

View File

@@ -12,3 +12,5 @@ node-types = { path = "../node-types" }
tracing = "0.1"
tracing-subscriber = { version = "0.3.3", features = ["env-filter"] }
tree-sitter-ql = { git = "https://github.com/tree-sitter/tree-sitter-ql.git" }
tree-sitter-ql-dbscheme = { git = "https://github.com/tausbn/tree-sitter-ql-dbscheme.git"}
tree-sitter-ql-yaml = {git = "https://github.com/tausbn/tree-sitter-ql.git", rev = "6fe85436702c92b0245d2b91908a12d6b0341f4c"}

View File

@@ -564,10 +564,20 @@ fn main() -> std::io::Result<()> {
let ql_library_path = matches.value_of("library").expect("missing --library");
let ql_library_path = PathBuf::from(ql_library_path);
let languages = vec![Language {
name: "QL".to_owned(),
node_types: tree_sitter_ql::NODE_TYPES,
}];
let languages = vec![
Language {
name: "QL".to_owned(),
node_types: tree_sitter_ql::NODE_TYPES,
},
Language {
name: "Dbscheme".to_owned(),
node_types: tree_sitter_ql_dbscheme::NODE_TYPES,
},
Language {
name: "Yaml".to_owned(),
node_types: tree_sitter_ql_yaml::NODE_TYPES,
},
];
let mut dbscheme_writer = LineWriter::new(File::create(dbscheme_path)?);
write!(
dbscheme_writer,

View File

@@ -1281,3 +1281,472 @@ module QL {
final override AstNode getAFieldOrChild() { ql_variable_def(this, result) }
}
}
module Dbscheme {
/** The base class for all AST nodes */
class AstNode extends @dbscheme_ast_node {
/** Gets a string representation of this element. */
string toString() { result = this.getAPrimaryQlClass() }
/** Gets the location of this element. */
final L::Location getLocation() { dbscheme_ast_node_info(this, _, _, result) }
/** Gets the parent of this element. */
final AstNode getParent() { dbscheme_ast_node_info(this, result, _, _) }
/** Gets the index of this node among the children of its parent. */
final int getParentIndex() { dbscheme_ast_node_info(this, _, result, _) }
/** Gets a field or child node of this node. */
AstNode getAFieldOrChild() { none() }
/** Gets the name of the primary QL class for this element. */
string getAPrimaryQlClass() { result = "???" }
/** Gets a comma-separated list of the names of the primary CodeQL classes to which this element belongs. */
string getPrimaryQlClasses() { result = concat(this.getAPrimaryQlClass(), ",") }
}
/** A token. */
class Token extends @dbscheme_token, AstNode {
/** Gets the value of this token. */
final string getValue() { dbscheme_tokeninfo(this, _, result) }
/** Gets a string representation of this element. */
final override string toString() { result = this.getValue() }
/** Gets the name of the primary QL class for this element. */
override string getAPrimaryQlClass() { result = "Token" }
}
/** A reserved word. */
class ReservedWord extends @dbscheme_reserved_word, Token {
/** Gets the name of the primary QL class for this element. */
final override string getAPrimaryQlClass() { result = "ReservedWord" }
}
/** A class representing `annotName` tokens. */
class AnnotName extends @dbscheme_token_annot_name, Token {
/** Gets the name of the primary QL class for this element. */
final override string getAPrimaryQlClass() { result = "AnnotName" }
}
/** A class representing `annotation` nodes. */
class Annotation extends @dbscheme_annotation, AstNode {
/** Gets the name of the primary QL class for this element. */
final override string getAPrimaryQlClass() { result = "Annotation" }
/** Gets the node corresponding to the field `argsAnnotation`. */
final ArgsAnnotation getArgsAnnotation() { dbscheme_annotation_args_annotation(this, result) }
/** Gets the node corresponding to the field `simpleAnnotation`. */
final AnnotName getSimpleAnnotation() { dbscheme_annotation_simple_annotation(this, result) }
/** Gets a field or child node of this node. */
final override AstNode getAFieldOrChild() {
dbscheme_annotation_args_annotation(this, result) or
dbscheme_annotation_simple_annotation(this, result)
}
}
/** A class representing `argsAnnotation` nodes. */
class ArgsAnnotation extends @dbscheme_args_annotation, AstNode {
/** Gets the name of the primary QL class for this element. */
final override string getAPrimaryQlClass() { result = "ArgsAnnotation" }
/** Gets the node corresponding to the field `name`. */
final AnnotName getName() { dbscheme_args_annotation_def(this, result) }
/** Gets the `i`th child of this node. */
final SimpleId getChild(int i) { dbscheme_args_annotation_child(this, i, result) }
/** Gets a field or child node of this node. */
final override AstNode getAFieldOrChild() {
dbscheme_args_annotation_def(this, result) or dbscheme_args_annotation_child(this, _, result)
}
}
/** A class representing `block_comment` tokens. */
class BlockComment extends @dbscheme_token_block_comment, Token {
/** Gets the name of the primary QL class for this element. */
final override string getAPrimaryQlClass() { result = "BlockComment" }
}
/** A class representing `boolean` tokens. */
class Boolean extends @dbscheme_token_boolean, Token {
/** Gets the name of the primary QL class for this element. */
final override string getAPrimaryQlClass() { result = "Boolean" }
}
/** A class representing `branch` nodes. */
class Branch extends @dbscheme_branch, AstNode {
/** Gets the name of the primary QL class for this element. */
final override string getAPrimaryQlClass() { result = "Branch" }
/** Gets the node corresponding to the field `qldoc`. */
final Qldoc getQldoc() { dbscheme_branch_qldoc(this, result) }
/** Gets the `i`th child of this node. */
final AstNode getChild(int i) { dbscheme_branch_child(this, i, result) }
/** Gets a field or child node of this node. */
final override AstNode getAFieldOrChild() {
dbscheme_branch_qldoc(this, result) or dbscheme_branch_child(this, _, result)
}
}
/** A class representing `caseDecl` nodes. */
class CaseDecl extends @dbscheme_case_decl, AstNode {
/** Gets the name of the primary QL class for this element. */
final override string getAPrimaryQlClass() { result = "CaseDecl" }
/** Gets the node corresponding to the field `base`. */
final Dbtype getBase() { dbscheme_case_decl_def(this, result, _) }
/** Gets the node corresponding to the field `discriminator`. */
final SimpleId getDiscriminator() { dbscheme_case_decl_def(this, _, result) }
/** Gets the `i`th child of this node. */
final Branch getChild(int i) { dbscheme_case_decl_child(this, i, result) }
/** Gets a field or child node of this node. */
final override AstNode getAFieldOrChild() {
dbscheme_case_decl_def(this, result, _) or
dbscheme_case_decl_def(this, _, result) or
dbscheme_case_decl_child(this, _, result)
}
}
/** A class representing `colType` nodes. */
class ColType extends @dbscheme_col_type, AstNode {
/** Gets the name of the primary QL class for this element. */
final override string getAPrimaryQlClass() { result = "ColType" }
/** Gets the child of this node. */
final AstNode getChild() { dbscheme_col_type_def(this, result) }
/** Gets a field or child node of this node. */
final override AstNode getAFieldOrChild() { dbscheme_col_type_def(this, result) }
}
/** A class representing `column` nodes. */
class Column extends @dbscheme_column, AstNode {
/** Gets the name of the primary QL class for this element. */
final override string getAPrimaryQlClass() { result = "Column" }
/** Gets the node corresponding to the field `colName`. */
final SimpleId getColName() { dbscheme_column_def(this, result, _, _) }
/** Gets the node corresponding to the field `colType`. */
final ColType getColType() { dbscheme_column_def(this, _, result, _) }
/** Gets the node corresponding to the field `isRef`. */
final Ref getIsRef() { dbscheme_column_is_ref(this, result) }
/** Gets the node corresponding to the field `isUnique`. */
final Unique getIsUnique() { dbscheme_column_is_unique(this, result) }
/** Gets the node corresponding to the field `qldoc`. */
final Qldoc getQldoc() { dbscheme_column_qldoc(this, result) }
/** Gets the node corresponding to the field `reprType`. */
final ReprType getReprType() { dbscheme_column_def(this, _, _, result) }
/** Gets a field or child node of this node. */
final override AstNode getAFieldOrChild() {
dbscheme_column_def(this, result, _, _) or
dbscheme_column_def(this, _, result, _) or
dbscheme_column_is_ref(this, result) or
dbscheme_column_is_unique(this, result) or
dbscheme_column_qldoc(this, result) or
dbscheme_column_def(this, _, _, result)
}
}
/** A class representing `date` tokens. */
class Date extends @dbscheme_token_date, Token {
/** Gets the name of the primary QL class for this element. */
final override string getAPrimaryQlClass() { result = "Date" }
}
/** A class representing `dbscheme` nodes. */
class Dbscheme extends @dbscheme_dbscheme, AstNode {
/** Gets the name of the primary QL class for this element. */
final override string getAPrimaryQlClass() { result = "Dbscheme" }
/** Gets the `i`th child of this node. */
final Entry getChild(int i) { dbscheme_dbscheme_child(this, i, result) }
/** Gets a field or child node of this node. */
final override AstNode getAFieldOrChild() { dbscheme_dbscheme_child(this, _, result) }
}
/** A class representing `dbtype` tokens. */
class Dbtype extends @dbscheme_token_dbtype, Token {
/** Gets the name of the primary QL class for this element. */
final override string getAPrimaryQlClass() { result = "Dbtype" }
}
/** A class representing `entry` nodes. */
class Entry extends @dbscheme_entry, AstNode {
/** Gets the name of the primary QL class for this element. */
final override string getAPrimaryQlClass() { result = "Entry" }
/** Gets the child of this node. */
final AstNode getChild() { dbscheme_entry_def(this, result) }
/** Gets a field or child node of this node. */
final override AstNode getAFieldOrChild() { dbscheme_entry_def(this, result) }
}
/** A class representing `float` tokens. */
class Float extends @dbscheme_token_float, Token {
/** Gets the name of the primary QL class for this element. */
final override string getAPrimaryQlClass() { result = "Float" }
}
/** A class representing `int` tokens. */
class Int extends @dbscheme_token_int, Token {
/** Gets the name of the primary QL class for this element. */
final override string getAPrimaryQlClass() { result = "Int" }
}
/** A class representing `integer` tokens. */
class Integer extends @dbscheme_token_integer, Token {
/** Gets the name of the primary QL class for this element. */
final override string getAPrimaryQlClass() { result = "Integer" }
}
/** A class representing `line_comment` tokens. */
class LineComment extends @dbscheme_token_line_comment, Token {
/** Gets the name of the primary QL class for this element. */
final override string getAPrimaryQlClass() { result = "LineComment" }
}
/** A class representing `qldoc` tokens. */
class Qldoc extends @dbscheme_token_qldoc, Token {
/** Gets the name of the primary QL class for this element. */
final override string getAPrimaryQlClass() { result = "Qldoc" }
}
/** A class representing `ref` tokens. */
class Ref extends @dbscheme_token_ref, Token {
/** Gets the name of the primary QL class for this element. */
final override string getAPrimaryQlClass() { result = "Ref" }
}
/** A class representing `reprType` nodes. */
class ReprType extends @dbscheme_repr_type, AstNode {
/** Gets the name of the primary QL class for this element. */
final override string getAPrimaryQlClass() { result = "ReprType" }
/** Gets the `i`th child of this node. */
final AstNode getChild(int i) { dbscheme_repr_type_child(this, i, result) }
/** Gets a field or child node of this node. */
final override AstNode getAFieldOrChild() { dbscheme_repr_type_child(this, _, result) }
}
/** A class representing `simpleId` tokens. */
class SimpleId extends @dbscheme_token_simple_id, Token {
/** Gets the name of the primary QL class for this element. */
final override string getAPrimaryQlClass() { result = "SimpleId" }
}
/** A class representing `string` tokens. */
class String extends @dbscheme_token_string, Token {
/** Gets the name of the primary QL class for this element. */
final override string getAPrimaryQlClass() { result = "String" }
}
/** A class representing `table` nodes. */
class Table extends @dbscheme_table, AstNode {
/** Gets the name of the primary QL class for this element. */
final override string getAPrimaryQlClass() { result = "Table" }
/** Gets the node corresponding to the field `tableName`. */
final TableName getTableName() { dbscheme_table_def(this, result) }
/** Gets the `i`th child of this node. */
final AstNode getChild(int i) { dbscheme_table_child(this, i, result) }
/** Gets a field or child node of this node. */
final override AstNode getAFieldOrChild() {
dbscheme_table_def(this, result) or dbscheme_table_child(this, _, result)
}
}
/** A class representing `tableName` nodes. */
class TableName extends @dbscheme_table_name, AstNode {
/** Gets the name of the primary QL class for this element. */
final override string getAPrimaryQlClass() { result = "TableName" }
/** Gets the child of this node. */
final SimpleId getChild() { dbscheme_table_name_def(this, result) }
/** Gets a field or child node of this node. */
final override AstNode getAFieldOrChild() { dbscheme_table_name_def(this, result) }
}
/** A class representing `unionDecl` nodes. */
class UnionDecl extends @dbscheme_union_decl, AstNode {
/** Gets the name of the primary QL class for this element. */
final override string getAPrimaryQlClass() { result = "UnionDecl" }
/** Gets the node corresponding to the field `base`. */
final Dbtype getBase() { dbscheme_union_decl_def(this, result) }
/** Gets the `i`th child of this node. */
final Dbtype getChild(int i) { dbscheme_union_decl_child(this, i, result) }
/** Gets a field or child node of this node. */
final override AstNode getAFieldOrChild() {
dbscheme_union_decl_def(this, result) or dbscheme_union_decl_child(this, _, result)
}
}
/** A class representing `unique` tokens. */
class Unique extends @dbscheme_token_unique, Token {
/** Gets the name of the primary QL class for this element. */
final override string getAPrimaryQlClass() { result = "Unique" }
}
/** A class representing `varchar` tokens. */
class Varchar extends @dbscheme_token_varchar, Token {
/** Gets the name of the primary QL class for this element. */
final override string getAPrimaryQlClass() { result = "Varchar" }
}
}
module Yaml {
/** The base class for all AST nodes */
class AstNode extends @yaml_ast_node {
/** Gets a string representation of this element. */
string toString() { result = this.getAPrimaryQlClass() }
/** Gets the location of this element. */
final L::Location getLocation() { yaml_ast_node_info(this, _, _, result) }
/** Gets the parent of this element. */
final AstNode getParent() { yaml_ast_node_info(this, result, _, _) }
/** Gets the index of this node among the children of its parent. */
final int getParentIndex() { yaml_ast_node_info(this, _, result, _) }
/** Gets a field or child node of this node. */
AstNode getAFieldOrChild() { none() }
/** Gets the name of the primary QL class for this element. */
string getAPrimaryQlClass() { result = "???" }
/** Gets a comma-separated list of the names of the primary CodeQL classes to which this element belongs. */
string getPrimaryQlClasses() { result = concat(this.getAPrimaryQlClass(), ",") }
}
/** A token. */
class Token extends @yaml_token, AstNode {
/** Gets the value of this token. */
final string getValue() { yaml_tokeninfo(this, _, result) }
/** Gets a string representation of this element. */
final override string toString() { result = this.getValue() }
/** Gets the name of the primary QL class for this element. */
override string getAPrimaryQlClass() { result = "Token" }
}
/** A reserved word. */
class ReservedWord extends @yaml_reserved_word, Token {
/** Gets the name of the primary QL class for this element. */
final override string getAPrimaryQlClass() { result = "ReservedWord" }
}
/** A class representing `comment` nodes. */
class Comment extends @yaml_comment, AstNode {
/** Gets the name of the primary QL class for this element. */
final override string getAPrimaryQlClass() { result = "Comment" }
/** Gets the child of this node. */
final Value getChild() { yaml_comment_def(this, result) }
/** Gets a field or child node of this node. */
final override AstNode getAFieldOrChild() { yaml_comment_def(this, result) }
}
/** A class representing `entry` nodes. */
class Entry extends @yaml_entry, AstNode {
/** Gets the name of the primary QL class for this element. */
final override string getAPrimaryQlClass() { result = "Entry" }
/** Gets the child of this node. */
final AstNode getChild() { yaml_entry_def(this, result) }
/** Gets a field or child node of this node. */
final override AstNode getAFieldOrChild() { yaml_entry_def(this, result) }
}
/** A class representing `key` nodes. */
class Key extends @yaml_key__, AstNode {
/** Gets the name of the primary QL class for this element. */
final override string getAPrimaryQlClass() { result = "Key" }
/** Gets the `i`th child of this node. */
final AstNode getChild(int i) { yaml_key_child(this, i, result) }
/** Gets a field or child node of this node. */
final override AstNode getAFieldOrChild() { yaml_key_child(this, _, result) }
}
/** A class representing `keyvaluepair` nodes. */
class Keyvaluepair extends @yaml_keyvaluepair, AstNode {
/** Gets the name of the primary QL class for this element. */
final override string getAPrimaryQlClass() { result = "Keyvaluepair" }
/** Gets the node corresponding to the field `key`. */
final Key getKey() { yaml_keyvaluepair_def(this, result, _) }
/** Gets the node corresponding to the field `value`. */
final Value getValue() { yaml_keyvaluepair_def(this, _, result) }
/** Gets a field or child node of this node. */
final override AstNode getAFieldOrChild() {
yaml_keyvaluepair_def(this, result, _) or yaml_keyvaluepair_def(this, _, result)
}
}
/** A class representing `listitem` nodes. */
class Listitem extends @yaml_listitem, AstNode {
/** Gets the name of the primary QL class for this element. */
final override string getAPrimaryQlClass() { result = "Listitem" }
/** Gets the child of this node. */
final Value getChild() { yaml_listitem_def(this, result) }
/** Gets a field or child node of this node. */
final override AstNode getAFieldOrChild() { yaml_listitem_def(this, result) }
}
/** A class representing `simpleId` tokens. */
class SimpleId extends @yaml_token_simple_id, Token {
/** Gets the name of the primary QL class for this element. */
final override string getAPrimaryQlClass() { result = "SimpleId" }
}
/** A class representing `value` tokens. */
class Value extends @yaml_token_value, Token {
/** Gets the name of the primary QL class for this element. */
final override string getAPrimaryQlClass() { result = "Value" }
}
/** A class representing `yaml` nodes. */
class Yaml extends @yaml_yaml, AstNode {
/** Gets the name of the primary QL class for this element. */
final override string getAPrimaryQlClass() { result = "Yaml" }
/** Gets the `i`th child of this node. */
final Entry getChild(int i) { yaml_yaml_child(this, i, result) }
/** Gets a field or child node of this node. */
final override AstNode getAFieldOrChild() { yaml_yaml_child(this, _, result) }
}
}

View File

@@ -935,3 +935,261 @@ ql_ast_node_info(
int loc: @location ref
);
dbscheme_annotation_args_annotation(
unique int dbscheme_annotation: @dbscheme_annotation ref,
unique int args_annotation: @dbscheme_args_annotation ref
);
dbscheme_annotation_simple_annotation(
unique int dbscheme_annotation: @dbscheme_annotation ref,
unique int simple_annotation: @dbscheme_token_annot_name ref
);
dbscheme_annotation_def(
unique int id: @dbscheme_annotation
);
#keyset[dbscheme_args_annotation, index]
dbscheme_args_annotation_child(
int dbscheme_args_annotation: @dbscheme_args_annotation ref,
int index: int ref,
unique int child: @dbscheme_token_simple_id ref
);
dbscheme_args_annotation_def(
unique int id: @dbscheme_args_annotation,
int name: @dbscheme_token_annot_name ref
);
dbscheme_branch_qldoc(
unique int dbscheme_branch: @dbscheme_branch ref,
unique int qldoc: @dbscheme_token_qldoc ref
);
@dbscheme_branch_child_type = @dbscheme_token_dbtype | @dbscheme_token_integer
#keyset[dbscheme_branch, index]
dbscheme_branch_child(
int dbscheme_branch: @dbscheme_branch ref,
int index: int ref,
unique int child: @dbscheme_branch_child_type ref
);
dbscheme_branch_def(
unique int id: @dbscheme_branch
);
#keyset[dbscheme_case_decl, index]
dbscheme_case_decl_child(
int dbscheme_case_decl: @dbscheme_case_decl ref,
int index: int ref,
unique int child: @dbscheme_branch ref
);
dbscheme_case_decl_def(
unique int id: @dbscheme_case_decl,
int base: @dbscheme_token_dbtype ref,
int discriminator: @dbscheme_token_simple_id ref
);
@dbscheme_colType_child_type = @dbscheme_token_boolean | @dbscheme_token_date | @dbscheme_token_dbtype | @dbscheme_token_float | @dbscheme_token_int | @dbscheme_token_string
dbscheme_col_type_def(
unique int id: @dbscheme_col_type,
int child: @dbscheme_colType_child_type ref
);
dbscheme_column_is_ref(
unique int dbscheme_column: @dbscheme_column ref,
unique int is_ref: @dbscheme_token_ref ref
);
dbscheme_column_is_unique(
unique int dbscheme_column: @dbscheme_column ref,
unique int is_unique: @dbscheme_token_unique ref
);
dbscheme_column_qldoc(
unique int dbscheme_column: @dbscheme_column ref,
unique int qldoc: @dbscheme_token_qldoc ref
);
dbscheme_column_def(
unique int id: @dbscheme_column,
int col_name: @dbscheme_token_simple_id ref,
int col_type: @dbscheme_col_type ref,
int repr_type: @dbscheme_repr_type ref
);
#keyset[dbscheme_dbscheme, index]
dbscheme_dbscheme_child(
int dbscheme_dbscheme: @dbscheme_dbscheme ref,
int index: int ref,
unique int child: @dbscheme_entry ref
);
dbscheme_dbscheme_def(
unique int id: @dbscheme_dbscheme
);
@dbscheme_entry_child_type = @dbscheme_case_decl | @dbscheme_table | @dbscheme_token_qldoc | @dbscheme_union_decl
dbscheme_entry_def(
unique int id: @dbscheme_entry,
int child: @dbscheme_entry_child_type ref
);
@dbscheme_reprType_child_type = @dbscheme_token_boolean | @dbscheme_token_date | @dbscheme_token_float | @dbscheme_token_int | @dbscheme_token_integer | @dbscheme_token_string | @dbscheme_token_varchar
#keyset[dbscheme_repr_type, index]
dbscheme_repr_type_child(
int dbscheme_repr_type: @dbscheme_repr_type ref,
int index: int ref,
unique int child: @dbscheme_reprType_child_type ref
);
dbscheme_repr_type_def(
unique int id: @dbscheme_repr_type
);
@dbscheme_table_child_type = @dbscheme_annotation | @dbscheme_column
#keyset[dbscheme_table, index]
dbscheme_table_child(
int dbscheme_table: @dbscheme_table ref,
int index: int ref,
unique int child: @dbscheme_table_child_type ref
);
dbscheme_table_def(
unique int id: @dbscheme_table,
int table_name: @dbscheme_table_name ref
);
dbscheme_table_name_def(
unique int id: @dbscheme_table_name,
int child: @dbscheme_token_simple_id ref
);
#keyset[dbscheme_union_decl, index]
dbscheme_union_decl_child(
int dbscheme_union_decl: @dbscheme_union_decl ref,
int index: int ref,
unique int child: @dbscheme_token_dbtype ref
);
dbscheme_union_decl_def(
unique int id: @dbscheme_union_decl,
int base: @dbscheme_token_dbtype ref
);
dbscheme_tokeninfo(
unique int id: @dbscheme_token,
int kind: int ref,
string value: string ref
);
case @dbscheme_token.kind of
0 = @dbscheme_reserved_word
| 1 = @dbscheme_token_annot_name
| 2 = @dbscheme_token_block_comment
| 3 = @dbscheme_token_boolean
| 4 = @dbscheme_token_date
| 5 = @dbscheme_token_dbtype
| 6 = @dbscheme_token_float
| 7 = @dbscheme_token_int
| 8 = @dbscheme_token_integer
| 9 = @dbscheme_token_line_comment
| 10 = @dbscheme_token_qldoc
| 11 = @dbscheme_token_ref
| 12 = @dbscheme_token_simple_id
| 13 = @dbscheme_token_string
| 14 = @dbscheme_token_unique
| 15 = @dbscheme_token_varchar
;
@dbscheme_ast_node = @dbscheme_annotation | @dbscheme_args_annotation | @dbscheme_branch | @dbscheme_case_decl | @dbscheme_col_type | @dbscheme_column | @dbscheme_dbscheme | @dbscheme_entry | @dbscheme_repr_type | @dbscheme_table | @dbscheme_table_name | @dbscheme_token | @dbscheme_union_decl
@dbscheme_ast_node_parent = @dbscheme_ast_node | @file
#keyset[parent, parent_index]
dbscheme_ast_node_info(
unique int node: @dbscheme_ast_node ref,
int parent: @dbscheme_ast_node_parent ref,
int parent_index: int ref,
int loc: @location ref
);
yaml_comment_def(
unique int id: @yaml_comment,
int child: @yaml_token_value ref
);
@yaml_entry_child_type = @yaml_comment | @yaml_keyvaluepair | @yaml_listitem
yaml_entry_def(
unique int id: @yaml_entry,
int child: @yaml_entry_child_type ref
);
@yaml_key_child_type = @yaml_key__ | @yaml_token_simple_id
#keyset[yaml_key__, index]
yaml_key_child(
int yaml_key__: @yaml_key__ ref,
int index: int ref,
unique int child: @yaml_key_child_type ref
);
yaml_key_def(
unique int id: @yaml_key__
);
yaml_keyvaluepair_def(
unique int id: @yaml_keyvaluepair,
int key__: @yaml_key__ ref,
int value: @yaml_token_value ref
);
yaml_listitem_def(
unique int id: @yaml_listitem,
int child: @yaml_token_value ref
);
#keyset[yaml_yaml, index]
yaml_yaml_child(
int yaml_yaml: @yaml_yaml ref,
int index: int ref,
unique int child: @yaml_entry ref
);
yaml_yaml_def(
unique int id: @yaml_yaml
);
yaml_tokeninfo(
unique int id: @yaml_token,
int kind: int ref,
string value: string ref
);
case @yaml_token.kind of
0 = @yaml_reserved_word
| 1 = @yaml_token_simple_id
| 2 = @yaml_token_value
;
@yaml_ast_node = @yaml_comment | @yaml_entry | @yaml_key__ | @yaml_keyvaluepair | @yaml_listitem | @yaml_token | @yaml_yaml
@yaml_ast_node_parent = @file | @yaml_ast_node
#keyset[parent, parent_index]
yaml_ast_node_info(
unique int node: @yaml_ast_node ref,
int parent: @yaml_ast_node_parent ref,
int parent_index: int ref,
int loc: @location ref
);