pt::util - Parser Tools

[ Tcllib Table Of Contents | Tcllib Index ]

pt::util(n) 1 "Parser Tools"

Name

pt::util - General utilities

Description

Are you lost ? Do you have trouble understanding this document ? In that case please read the overview provided by the Introduction to Parser Tools. This document is the entrypoint to the whole system the current package is a part of.

This package provides general utility commands.

This is a supporting package in the Core Layer of Parser Tools.

arch_core_support

API

::pt::util error2readable error text

This command takes the structured form of a syntax error as thrown by parser runtimes and the input text to the parser which caused that error and returns a string describing the error in a human-readable form.

The input text is required to convert the character position of the error into a more readable line/column format, and to provide excerpts of the input around the error position.

::pt::util error2position error text

This command takes the structured form of a syntax error as thrown by parser runtimes and the input text to the parser which caused that error and returns a 2-element list containing the line number and column index for the error's character position in the input, in this order.

::pt::util error2text error

This command takes the structured form of a syntax error as thrown by parser runtimes and returns a list of strings, each describing a possible expected input in a human-readable form.

Bugs, Ideas, Feedback

This document, and the package it describes, will undoubtedly contain bugs and other problems. Please report such in the category pt of the Tcllib Trackers. Please also report any ideas for enhancements you may have for either package and/or documentation.

Category

Parsing and Grammars

Copyright © 2015 for compilation: ActiveState