Difference: TWikiIfDotPm (1 vs. 2)

Revision 22007-01-16 - TWikiContributor

 

Package TWiki::If

Support for the conditions in %IF{} statements. Basically a simple stack-based parser for infix expressions that generates a parse tree that can subsequently be evaluated.

ClassMethod new (\%operators) -> \%factory

Added:
>
>
 Construct a new if node factory.
Added:
>
>
 
  • \%operators reference to a hash of operators.
Added:
>
>
 Each operator must have the following fields: prec (precedence) type (0 unary 1 binary) exec (ref to a function to execute). If not provided, the default set of boolean operations supported by %IF is used.

ObjectMethod evaluate ($twiki) -> $result

Added:
>
>
 Execute the parse node.

!!!new!!!

ObjectMethod parse ($string) -> \$if

Added:
>
>
 
  • $string - string containing an expression to parse
Added:
>
>
 Construct a new search node by parsing the passed expression. Return the new object.

Revision 12006-02-01 - TWikiContributor

 

Package TWiki::If

Support for the conditions in %IF{} statements. Basically a simple stack-based parser for infix expressions that generates a parse tree that can subsequently be evaluated.

ClassMethod new (\%operators) -> \%factory

Construct a new if node factory.
  • \%operators reference to a hash of operators.
Each operator must have the following fields: prec (precedence) type (0 unary 1 binary) exec (ref to a function to execute). If not provided, the default set of boolean operations supported by %IF is used.

ObjectMethod evaluate ($twiki) -> $result

Execute the parse node.

!!!new!!!

ObjectMethod parse ($string) -> \$if

  • $string - string containing an expression to parse
Construct a new search node by parsing the passed expression. Return the new object.

 
This site is powered by the TWiki collaboration platform Powered by Perl This site is powered by the TWiki collaboration platformCopyright © by the contributing authors. All material on this collaboration platform is the property of the contributing authors.
Ideas, requests, problems regarding KoreaCmsWiki? Send feedback
Note: Please contribute updates to this topic on TWiki.org at TWiki:TWiki.TWikiIfDotPm