is a static analysis tool to count different programming language constructs. The tool functions in two modes: count mode and print mode

Count Mode

python lang nodeType arg filename1 filename2 .... filenamen 

will output the number of nodeTypes under the argument arg in the source file filename which is written in language lang. It will also output valuable information about the AST depending on the outputOption.

Supported langs:

Supported nodeTypes:

(The infrastructure is there to count many more nodes. I’m only adding them to this once they’ve been tested against Sam’s tool to make sure they’re correct)

You can count nodes on any number of filenames. The number returned will be the sum number of nodeTypes in all of the filenames.

python outputOption filename lang

Supported outputOptions:

Example Calls:

Python -py –For -Void Counts the number of for loops in

Python -py –Call check1 Counts the number of calls to the function “check1” in Function “check1” may or may not exist in

Python -json -cpp hw1.cpp Prints a json representation of the AST of hw1.cpp