33 */
44
55private import AstNodes
6+ private import Idents
7+ private import Expr
8+ private import Misc
69private import internal.AstNodes
710private import internal.TreeSitter
811private import internal.Stmts
@@ -14,6 +17,11 @@ private import internal.ImportWithStatement
1417private import internal.Infrastructure
1518private import internal.Statement
1619private import internal.UsingStatement
20+ private import internal.Parameter
21+ private import internal.Parameters
22+ private import internal.ParameterDeclaration
23+ private import internal.OutputDeclaration
24+ private import internal.UserDefinedFunction
1725// CFG
1826private import codeql.bicep.CFG
1927private import codeql.bicep.controlflow.internal.ControlFlowGraphImpl as CfgImpl
@@ -57,6 +65,92 @@ class Infrastructure extends AstNode instanceof InfrastructureImpl {
5765 Stmts getStatement ( int index ) { result = InfrastructureImpl .super .getStatement ( index ) }
5866}
5967
68+ /**
69+ * Represents a parameter declaration node in the AST.
70+ * Provides access to the identifier, name, type, and default value of the parameter.
71+ */
72+ class ParameterDeclaration extends AstNode instanceof ParameterDeclarationImpl {
73+ /** Gets the identifier of the parameter declaration. */
74+ Identifier getIdentifier ( ) { result = ParameterDeclarationImpl .super .getName ( ) }
75+
76+ /** Gets the name of the parameter declaration. */
77+ string getName ( ) { result = this .getIdentifier ( ) .getName ( ) }
78+
79+ /** Gets the type of the parameter declaration. */
80+ Type getType ( ) { result = ParameterDeclarationImpl .super .getType ( ) }
81+
82+ /** Gets the default value of the parameter declaration, if any. */
83+ Expr getDefaultValue ( ) { result = ParameterDeclarationImpl .super .getDefaultValue ( ) }
84+ }
85+
86+
87+ /**
88+ * Represents an output declaration node in the AST.
89+ * Provides access to the identifier, name, type, and value of the output.
90+ */
91+ class OutputDeclaration extends AstNode instanceof OutputDeclarationImpl {
92+ /** Gets the identifier of the output declaration. */
93+ Identifier getIdentifier ( ) { result = OutputDeclarationImpl .super .getIdentifier ( ) }
94+
95+ /** Gets the name of the output declaration. */
96+ string getName ( ) { result = this .getIdentifier ( ) .getName ( ) }
97+
98+ /** Gets the type of the output declaration. */
99+ Type getType ( ) { result = OutputDeclarationImpl .super .getType ( ) }
100+
101+ /** Gets the value of the output declaration. */
102+ Expr getValue ( ) { result = OutputDeclarationImpl .super .getValue ( ) }
103+ }
104+
105+ /**
106+ * Represents a user-defined function node in the AST.
107+ * Provides access to the identifier, name, return type, parameters, and body of the function.
108+ */
109+ class UserDefinedFunction extends AstNode instanceof UserDefinedFunctionImpl {
110+ /** Gets the identifier of the user-defined function. */
111+ Identifier getIdentifier ( ) { result = UserDefinedFunctionImpl .super .getName ( ) }
112+
113+ /** Gets the name of the user-defined function. */
114+ string getName ( ) { result = this .getIdentifier ( ) .getName ( ) }
115+
116+ /** Gets the return type of the user-defined function. */
117+ Type getReturnType ( ) { result = UserDefinedFunctionImpl .super .getReturnType ( ) }
118+
119+ /** Gets the declared parameters of the user-defined function. */
120+ Parameters getDeclaredParameters ( ) { result = UserDefinedFunctionImpl .super .getParameters ( ) }
121+
122+ /** Gets all parameters of the user-defined function. */
123+ Parameter getParameters ( ) { result = this .getDeclaredParameters ( ) .getParameter ( _) }
124+
125+ /** Gets the parameter at the specified index. */
126+ Parameter getParameter ( int index ) { result = this .getDeclaredParameters ( ) .getParameter ( index ) }
127+
128+ /** Gets the body of the user-defined function. */
129+ Expr getBody ( ) { result = UserDefinedFunctionImpl .super .getBody ( ) }
130+ }
131+
132+ /**
133+ * Represents a parameter node in the AST.
134+ * Provides access to the parameter's name and type.
135+ */
136+ class Parameter extends AstNode instanceof ParameterImpl {
137+ /** Gets the name of the parameter. */
138+ Idents getName ( ) { result = ParameterImpl .super .getName ( ) }
139+
140+ /** Gets the type of the parameter. */
141+ Type getType ( ) { result = ParameterImpl .super .getType ( ) }
142+ }
143+
144+ /**
145+ * Represents a parameters node in the AST.
146+ * Provides access to individual parameters by index.
147+ */
148+ class Parameters extends AstNode instanceof ParametersImpl {
149+ /** Gets the parameter at the specified index. */
150+ Parameter getParameter ( int index ) { result = ParametersImpl .super .getParameter ( index ) }
151+ }
152+
153+
60154/**
61155 * A ImportWithStatement statement
62156 */
0 commit comments