Skip to main content

module lang::php::config::Config

rascal-0.42.0
org.rascalmpl.php-analysis-0.3.3

Usage

import lang::php::config::Config;

Dependencies

import lang::php::util::Option;
import IO;
import Exception;
import String;
import util::SystemAPI;
import lang::yaml::Model;

data Exception

data Exception  
= configMissing(str key, str msg)
;

data Config

data Config  
= config(
Option[bool] usePhpParserJar,
Option[loc] phpLoc,
Option[loc] parserLoc,
Option[loc] analysisLoc,
Option[str] parserMemLimit,
Option[str] astToRascal,
Option[loc] parserWorkingDir,
Option[loc] baseLoc,
Option[loc] parsedDir,
Option[loc] statsDir,
Option[loc] corpusRoot,
Option[loc] countsDir,
Option[bool] useBinaries,
Option[int] logLevel,
Option[loc] clocLoc)
| emptyConfig()
;

function getConfig

Config getConfig()

function findStringValueInMappingByKey

Option[str] findStringValueInMappingByKey(Node yml, str key)

function findLocValueInMappingByKey

Option[loc] findLocValueInMappingByKey(Node yml, str key)

function findIntValueInMappingByKey

Option[int] findIntValueInMappingByKey(Node yml, str key)

function findBoolValueInMappingByKey

Option[bool] findBoolValueInMappingByKey(Node yml, str key)

function loadConfig

Config loadConfig()

function usePhpParserJar

bool usePhpParserJar()

Indicates whether to use the parser contained in a distributed jar file or from the directory given below

function phpLoc

loc phpLoc()

The location of the PHP executable

function parserLoc

loc parserLoc()

The base install location for the PHP-Parser project

function analysisLoc

loc analysisLoc()

The base install location for the php-analysis project

function parserMemLimit

str parserMemLimit()

The memory limit for PHP when the parser is run

function astToRascal

str astToRascal()

The location of the AST2Rascal.php file, inside the PHP-Parser directories

function parserWorkingDir

loc parserWorkingDir()

The working directory for when the parser runs

function baseLoc

loc baseLoc()

The base location for the corpus and any serialized files

function parsedDir

loc parsedDir()

Where to put the binary representations of parsed systems

function statsDir

loc statsDir()

Where to put the binary representations of extracted statistics

function corpusRoot

loc corpusRoot()

Where the PHP sources for the corpus reside

function countsDir

loc countsDir()

Where to put extracted counts (e.g., SLOC)

function useBinaries

bool useBinaries()

This should only ever be true if we don't have source, we only have the extracted binaries for parsed systems

function logLevel

int logLevel()

Debugging options @logLevel { Log level 0 => no logging; Log level 1 => main logging; Log level 2 => debug logging; }

function clocLoc

loc clocLoc()

The location of the cloc tool