Skip to content

foundeo/cfmlparser

master
Switch branches/tags

Name already in use

A tag already exists with the provided branch name. Many Git commands accept both tag and branch names, so creating this branch may cause unexpected behavior. Are you sure you want to create this branch?
Code

Latest commit

 

Git stats

Files

Permalink
Failed to load latest commit information.
Type
Name
Latest commit message
Commit time
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 

cfmlparser

A CFML Parser written in CFML

Build Status

Basic Usage

file = new cfmlparser.File("/path/to/file.cfm");
statements = file.getStatements();
info = [];
for (s in statements) {
	if (s.isTag()) {
		arrayAppend(info, {type:"tag", name:s.getName(), attributes:s.getAttributes(), start:s.getStartPosition(), end:s.getEndPosition()});
	} else if (s.isComment()) {
		arrayAppend(info, {type:"comment", comment:s.getComment(), start:s.getStartPosition(), end:s.getEndPosition()});
	}
}
writeDump(info);

How it works

Parses the file into an array of Statement objects, the statements may be a CFML tag, a CFML comment or a cfscript statement (todo).

If the statement is a CFML tag, then you will have an instance of the Tag component, with methods such as getAttributes() hasAttributes() getInnerContent() hasInnerContent() etc.

Known Issues / Limitations

  • Currently does not parse cfscript or or script based CFCs (todo)

About

A CFML Parser written in CFML

Topics

Resources

License

Stars

Watchers

Forks

Releases

No releases published

Packages

No packages published