swcl.lib.code
Class Code
Library for parsing "js-like-doc" on server or clientside. The output is in IFE Wiki.
Keyword @license
Keyword @author
Keyword @class
Keyword @function
Keyword @param
Keyword @returns
Keyword @throws
Keyword @field
Keyword @endfunction
Keyword @endclass
Fields
The following fields are defined in the class Code:
STATE_LINE, STATE_PRE_LINE, STATE_START, STATE_WORDS, handlers
int Code.STATE_LINE
Defines the parser state parsing a line
int Code.STATE_PRE_LINE
Defines the parser state before parsing a line
int Code.STATE_START
Defines the parser state at the beginning of the parsing process
int Code.STATE_WORDS
Defines the parser state parsing words within a heading or line
Handler[] Code.handlers
Contains the list of the mapped handlers.
Methods
The following functions are methods of the class Code:
Code, addHandler, findAllHandlers, findHandler, renderAsWiki, replaceHandler
Constructor Code()
Creates a new instance of Code
void Code.addHandler(Handler handler)
Adds a new handler object to the end of the handler list.
Parameter Handler handler
Handler[] Code.findAllHandlers(Parser parser)
Returns all matching handlers for the given parser
Parameter Parser parser
Returns Handler[]
- The found handlers
- [] Otherwise
Handler Code.findHandler(Parser parser)
Returns the first matching handler for the given parser
Parameter Parser parser
Returns Handler
- The found handler
- null Otherwise
string Code.renderAsWiki(string text, object options)
Returns the parsed documentation as IFE Wiki.
Parameter string text
Parameter object options
Returns string
the parsed and into wiki notation rendered inplace documentation of the given text
boolean Code.replaceHandler(Handler handler)
Replaces a handler for the given name in the handler list
Parameter Handler handler
Returns boolean
- true If the handler was replaced
- false Otherwise