English     Español
[Main Index] : Programming : Languages : Perl : CPAN Modules : Language Interfaces : Blatte
 Blatte::Parser CPAN (Perl) Module 

Search

 

Documents

Blatte::Parser - parser for Blatte syntax (Displayed)

Blatte::Parser - parser for Blatte syntax


NAME

Blatte::Parser - parser for Blatte syntax


SYNOPSIS

  use Blatte::Parser;
  $parser = new Blatte::Parser();
  $perl_expr = $parser->parse(INPUT);
    or
  $parsed_expr = $parser->expr(INPUT);
  if (defined($parsed_expr)) {
    $perl_expr = $parsed_expr->transform();
  }


DESCRIPTION

A parser for turning written Blatte expressions into their Perl equivalents or into Blatte's syntax-tree representation.


METHODS

$parser->parse(INPUT)
Parses the first Blatte expression in INPUT and returns the corresponding Perl string, or undef if an error occurred.

INPUT may be a string or a reference to a string. If it's the latter, then after a successful parse, the parsed expression will be removed from the beginning of the string.

$parser->expr(INPUT)
Like parse(), except the result is not converted to Perl; it's left in Blatte's internal parse-tree format, which uses the Blatte::Syntax family of objects.

$parser->eof(INPUT)
Tests INPUT for end-of-file. Leading whitespace is removed from INPUT with consume_whitespace and, if nothing remains, true is returned, else undef.


OTHER FUNCTIONS

consume_whitespace(STRING_REF)
Given a reference to a string containing Blatte code, this function modifies the string to remove all leading whitespace, comments, and forget-whitespace operators. It discards any comments from, and applies any forget-whitespace operators to the consumed whitespace and returns the resulting whitespace.

This function is called internally by the parser prior to matching each token of the input.


AUTHOR

Bob Glickstein <bobg@zanshin.com>.

Visit the Blatte website, <http://www.blatte.org/>.


LICENSE

Copyright 2001 Bob Glickstein. All rights reserved.

Blatte is distributed under the terms of the GNU General Public License, version 2. See the file LICENSE that accompanies the Blatte distribution.


SEE ALSO

Blatte(3), the Blatte::Compiler(3) manpage, the Blatte::Syntax(3) manpage.

Information

This site is currently in testing, it is not yet operating using the full database. Until it is officially launched you may wish to visit Help-Site Computer Manuals. After launch, this site (HelpSpy) will replace Help-Site. Information about the spider which is currently trawling the Internet looking for links to add to this directory can be found here.
   

©Copyright Nicholas Reynolds 2004