@@ -92,6 +92,7 @@ ast = astUtil.astFromPath("/test1.cfm");
9292```
9393
9494This approach is particularly useful when:
95+
9596- Building extensions or plugins
9697- Creating development tools
9798- Performing batch analysis of multiple files
@@ -102,6 +103,7 @@ This approach is particularly useful when:
102103The returned AST uses neutral, language-agnostic node types that follow ESTree conventions:
103104
104105### Root Structure
106+
105107``` cfml
106108{
107109 "type": "Program", // Root AST node
@@ -115,13 +117,15 @@ The returned AST uses neutral, language-agnostic node types that follow ESTree c
115117### Common Node Types
116118
117119** Expressions:**
120+
118121- ` BinaryExpression ` - Operations like ` x + y ` , ` a && b `
119122- ` UnaryExpression ` - Operations like ` !condition ` , ` -number `
120123- ` CallExpression ` - Function calls like ` myFunction(arg1, arg2) `
121124- ` MemberExpression ` - Property access like ` obj.property `
122125- ` ConditionalExpression ` - Ternary operator ` condition ? true : false `
123126
124127** Literals:**
128+
125129- ` StringLiteral ` - String values like ` "hello" `
126130- ` NumberLiteral ` - Numeric values like ` 42 ` , ` 3.14 `
127131- ` BooleanLiteral ` - Boolean values ` true ` , ` false `
@@ -130,6 +134,7 @@ The returned AST uses neutral, language-agnostic node types that follow ESTree c
130134- ` ObjectExpression ` - Struct literals like ` {name: "value"} `
131135
132136** Statements:**
137+
133138- ` IfStatement ` - Conditional statements
134139- ` ForStatement ` - Traditional for loops
135140- ` WhileStatement ` - While loops
@@ -138,6 +143,7 @@ The returned AST uses neutral, language-agnostic node types that follow ESTree c
138143- ` FunctionDeclaration ` - Function definitions
139144
140145** CFML-Specific:**
146+
141147- ` CFMLTag ` - CFML tags like ` <cfquery> ` , ` <cfloop> `
142148- ` ClosureExpression ` - Anonymous functions
143149- ` LambdaExpression ` - Arrow functions
@@ -187,16 +193,19 @@ if (ast.type == "Program" && arrayLen(ast.body) > 0) {
187193The AST functionality integrates well with various development scenarios:
188194
189195### IDE Extensions
196+
190197- Use AST for syntax highlighting
191198- Implement intelligent autocomplete
192199- Build refactoring tools
193200
194201### Static Analysis Tools
202+
195203- Detect code smells and anti-patterns
196204- Enforce coding standards
197205- Calculate complexity metrics
198206
199207### Documentation Generators
208+
200209- Extract function signatures and comments
201210- Generate API documentation automatically
202211- Create dependency graphs
@@ -208,6 +217,7 @@ A complete working example is available as a Docker setup:
208217** Repository** : [ https://github.com/lucee/lucee-docs/tree/master/examples/docker/ast ] ( https://github.com/lucee/lucee-docs/tree/master/examples/docker/ast )
209218
210219The demo includes:
220+
211221- Docker Compose configuration with Lucee 7.0.0.299-SNAPSHOT
212222- Example templates demonstrating both built-in functions and Java class usage
213223- Ready-to-run environment for testing AST functionality
0 commit comments