Difference between revisions of "Owl Lua API"

From Owl
Jump to: navigation, search
(Owl Lua API)
(utils Class)
Line 18: Line 18:
  
 
The <code>utils</code> class contains static methods to make common routines in parsers more accessible.
 
The <code>utils</code> class contains static methods to make common routines in parsers more accessible.
 +
 +
=== <code>utils.md5()</code> ===
 +
 +
Returns an ASCII md5 encoding of the given string.
  
 
'''Syntax'''
 
'''Syntax'''
<syntaxhighlight lang="php">
+
<syntaxhighlight lang="lua">local encodedString = utils.md5(rawstring)</syntaxhighlight>
<?php
+
 
    $v = "string";    // sample initialization
+
* Parameters
?>
+
** ''rawstring'' (string) - The string to be encoded.
html text
+
 
<?
+
* Return Value
    echo $v;        // end of php code
+
* ''encodedString'' (string) - The ASCII'd md5 string
?>
 
</syntaxhighlight>
 

Revision as of 12:24, 3 March 2013

Owl Lua API

The Owl Lua API is a platform for building parsers in Owl. It consists of instantiable classes and static objects. Each response is processed through HTML Tidy so that all HTML returned is valid XHTML.

regexp Class

The regexp class exposes a POSIX implementation of regular expressions. The class's API is modeled after Qt 4.x's QRegExp implementation.

regexp.new()

Initializes a new instance of the regexp class.

sgml Class

The sgml class parses Html markup and builds an SGML DOM. Note: Parsing of even well formed documents can be slow for very large files.

utils Class

The utils class contains static methods to make common routines in parsers more accessible.

utils.md5()

Returns an ASCII md5 encoding of the given string.

Syntax <syntaxhighlight lang="lua">local encodedString = utils.md5(rawstring)</syntaxhighlight>

  • Parameters
    • rawstring (string) - The string to be encoded.
  • Return Value
  • encodedString (string) - The ASCII'd md5 string