Skip to content

alejandroinfante/SrcML-PharoWrapper

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

8 Commits
 
 
 
 
 
 
 
 

Repository files navigation

SrcML-PharoWrapper

Simple wrapper of SrcML for Pharo

Getting started

  1. Download SrcML binaries from SrcML website and extract them in your filesystem.
  2. Copy or create a symlink for the dynamic libraries inside the srcml/lib folder to the folder of the Pharo image.
  3. Copy or create a symlink for the SrcML binary in srcml/bin/srcml to the folder of the image (working directory).
  4. Install XMLParser and XPath from the Pharo catalog.
  5. Run the tests of the package.

How to use

There are two use modes of this wrapper.

Extract and analyze a directory

Extract and analyze all the source files in a directory.

(SrcML extractFromDir: 'PATH/TO/SOURCE/DIRECTORY') xml

Extract and analyze a String

Extract and analyze the source code stored in a String in Pharo. In this case it is mandatory to pass the target language to SourceML.

(SrcML extractFromCode: sourceCodeString language: 'C++') xml. "-> Extract the code using a C++ parser."
(SrcML extractJavaFromCode: sourceCodeString) xml. "-> Syntactic sugar for extracting the code using a Java parser"

About

Simple wrapper of SrcML for Pharo

Resources

License

Stars

Watchers

Forks

Releases

No releases published

Packages