PHP Classes

SourceMap: Tokenize source code in several languages

Recommend this page to a friend!
  Info   View files View files (12)   DownloadInstall with Composer Download .zip   Reputation   Support forum   Blog    
Ratings Unique User Downloads Download Rankings
StarStarStar 52%Total: 1,332 This week: 1All time: 2,905 This week: 571Up
Version License Categories
sourcemap 1.0.0GNU General Publi...Text processing
Description 

Author

This class can be used to parse and extract a list of tokens from source code in one of several supported languages.

It can parse source code in a given language and extract tokens according to the definitions of token delimiter character sequences for that language. The class supports PHP, Javascript and Python.

It can extract several types of tokens: comments in one or more lines, single or double quoted strings and pure code. Other tokens may be supported by adding rules for them to the delimiters definitions.

The parsed tokens are returned as an array that includes the name of the token delimiter as well its start and end positions in the original source code text.

Picture of Andrea Giammarchi
Name: Andrea Giammarchi <contact>
Classes: 17 packages by
Country: Italy Italy
Age: 45
All time rank: 192 in Italy Italy
Week rank: 103 Down4 in Italy Italy Down
Innovation award
Innovation award
Nominee: 5x

  Files folder image Files  
File Role Description
Plain text file SourceMap.class.php Class PHP Version
Accessible without login Plain text file delimeters.php Aux. Delimeters Example
Accessible without login Plain text file common.php Aux. External Utilities
Accessible without login Plain text file testphp.php Example SimpleTest File
Accessible without login Plain text file common.js Data JavaScript External Utilities
Accessible without login Plain text file common.py Data Python External Utilities
Accessible without login Plain text file delimeters.js Data JavaScript Delimeters Example
Accessible without login Plain text file delimeters.py Data Python Delimeters Example
Accessible without login Plain text file SourceMap.js Data JavaScript Version
Accessible without login Plain text file SourceMap.py Data Python Version
Accessible without login Plain text file testjs.php Aux. JavaScript Test Page
Accessible without login Plain text file testpy.py Data Python Test File

 Version Control Reuses Unique User Downloads Download Rankings  
 0%3
Total:1,332
This week:1
All time:2,905
This week:571Up
 User Ratings  
 
 All time
Utility:75%StarStarStarStar
Consistency:75%StarStarStarStar
Documentation:-
Examples:75%StarStarStarStar
Tests:-
Videos:-
Overall:52%StarStarStar
Rank:2331