module lang::rascal::tutor::apidoc::ExtractInfo
rascal-0.40.13-BOOT2
rascal-tutor-0.19.9
Usage
import lang::rascal::tutor::apidoc::ExtractInfo;
Dependencies
import IO;
import String;
import lang::rascal::\syntax::Rascal;
import ParseTree;
import util::Reflective;
import DateTime;
import lang::rascal::tutor::apidoc::DeclarationInfo;
function extractInfo
Extract declaration information from a Rascal module at given location.
list[DeclarationInfo] extractInfo(loc moduleLoc)
function doExtractInfo
list[DeclarationInfo] doExtractInfo(loc moduleLoc, datetime _/*lastModified*/)
function extractModule
list[DeclarationInfo] extractModule(m: (Module) `<Header header> <Body body>`)
function extractImport
default list[DeclarationInfo] extractImport(str moduleName, (Import) `<SyntaxDefinition def>` )
default list[DeclarationInfo] extractImport(str _moduleName, Import _ )
function extractTopLevel
list[DeclarationInfo] extractTopLevel(str moduleName, (Toplevel) `<Declaration decl>`)
function extractDecl
list[DeclarationInfo] extractDecl(str moduleName, d: (Declaration) `<Tags tags> <Visibility visibility> <Type tp> <{Variable ","}+ variables> ;`)
list[DeclarationInfo] extractDecl(str moduleName, d: (Declaration) `<Tags tags> <Visibility visibility> anno <Type annoType> <Type onType>@<Name name> ;`)
list[DeclarationInfo] extractDecl(str moduleName, d: (Declaration) `<Tags tags> <Visibility visibility> alias <UserType user> = <Type base> ;`)
list[DeclarationInfo] extractDecl(str moduleName, d: (Declaration) `<Tags tags> <Visibility visibility> tag <Kind kind> <Name name> on <{Type ","}+ types> ;`)
list[DeclarationInfo] extractDecl(str moduleName, d: (Declaration) `<Tags tags> <Visibility visibility> data <UserType user> ;`)
function align
str align({Variant "|"}+ variants)
function extractDecl
list[DeclarationInfo] extractDecl(str moduleName, d: (Declaration) `<Tags tags> <Visibility visibility> data <UserType user> <CommonKeywordParameters commonKeywordParameters> ;`)
list[DeclarationInfo] extractDecl(str moduleName, d: (Declaration) `<Tags tags> <Visibility visibility> data <UserType user> <CommonKeywordParameters commonKeywordParameters> = <{Variant "|"}+ variants> ;`)
function genVariant
DeclarationInfo genVariant(str moduleName, v: (Variant) `<Name name>(<{TypeArg ","}* _> <KeywordFormals _>)`)
function extractDecl
list[DeclarationInfo] extractDecl(str moduleName, d: (Declaration) `<FunctionDeclaration functionDeclaration>`)
default list[DeclarationInfo] extractDecl(str moduleName, d: (Declaration) `<FunctionDeclaration functionDeclaration>`)
function extractFunDecl
DeclarationInfo extractFunDecl(str moduleName, fd: (FunctionDeclaration) `<Tags tags> <Visibility visibility> <Signature signature> ;`)
DeclarationInfo extractFunDecl(str moduleName, fd: (FunctionDeclaration) `<Tags tags> <Visibility visibility> <Signature signature> = <Expression expression> ;`)
DeclarationInfo extractFunDecl(str moduleName, fd: (FunctionDeclaration) `<Tags tags> <Visibility visibility> <Signature signature> = <Expression expression> when <{Expression ","}+ conditions>;`)
DeclarationInfo extractFunDecl(str moduleName, fd: (FunctionDeclaration) `<Tags tags> <Visibility visibility> <Signature signature> <FunctionBody body>`)
function extractFunctionDeclaration
DeclarationInfo extractFunctionDeclaration(str moduleName, FunctionDeclaration fd)
function extractTestDecl
DeclarationInfo extractTestDecl(str moduleName, FunctionDeclaration fd)
function removeTags
Tree removeTags(Tree x)
function sentenify
Start synopsis' with capitals and end with periods.
str sentenify(str synopsis:/^<head:[a-z]><tail:.*>/)
str sentenify(str synopsis:/[^\.]$/)
default str sentenify(str x)
function getSynopsis
str getSynopsis(rel[str, DocTag] tags)
function isTutorTag
bool isTutorTag(str label)
function getTagContents
extracts the contents of all tags from a declaration syntax tree and stores origin information
rel[str, DocTag] getTagContents(Tags tags)
function sortedDocTags
lists the supported documentation tags in the prescribed order
list[DocTag] sortedDocTags(rel[str, DocTag] tags)