1pt::util(n)                      Parser Tools                      pt::util(n)
2
3
4
5______________________________________________________________________________
6

NAME

8       pt::util - General utilities
9

SYNOPSIS

11       package require Tcl  8.5
12
13       package require pt::ast  ?1.1?
14
15       ::pt::util error2readable error text
16
17       ::pt::util error2position error text
18
19       ::pt::util error2text error
20
21______________________________________________________________________________
22

DESCRIPTION

24       Are  you  lost ?  Do you have trouble understanding this document ?  In
25       that case please read the overview  provided  by  the  Introduction  to
26       Parser  Tools.  This document is the entrypoint to the whole system the
27       current package is a part of.
28
29       This package provides general utility commands.
30
31       This is a supporting package in the Core Layer of Parser Tools.
32
33       IMAGE: arch_core_support
34

API

36       ::pt::util error2readable error text
37              This command takes the structured form  of  a  syntax  error  as
38              thrown by parser runtimes and the input text to the parser which
39              caused that error and returns a string describing the error in a
40              human-readable form.
41
42              The  input text is required to convert the character position of
43              the error into a more readable line/column format, and  to  pro‐
44              vide excerpts of the input around the error position.
45
46       ::pt::util error2position error text
47              This  command  takes  the  structured  form of a syntax error as
48              thrown by parser runtimes and the input text to the parser which
49              caused  that  error  and returns a 2-element list containing the
50              line number and column index for the error's character  position
51              in the input, in this order.
52
53       ::pt::util error2text error
54              This  command  takes  the  structured  form of a syntax error as
55              thrown by parser runtimes and returns a list  of  strings,  each
56              describing a possible expected input in a human-readable form.
57

BUGS, IDEAS, FEEDBACK

59       This  document,  and the package it describes, will undoubtedly contain
60       bugs and other problems.  Please report such in the category pt of  the
61       Tcllib  Trackers  [http://core.tcl.tk/tcllib/reportlist].   Please also
62       report any ideas for enhancements  you  may  have  for  either  package
63       and/or documentation.
64
65       When proposing code changes, please provide unified diffs, i.e the out‐
66       put of diff -u.
67
68       Note further that  attachments  are  strongly  preferred  over  inlined
69       patches.  Attachments  can  be  made  by  going to the Edit form of the
70       ticket immediately after its creation, and  then  using  the  left-most
71       button in the secondary navigation bar.
72

KEYWORDS

74       EBNF,  LL(k),  PEG,  TDPL, context-free languages, expression, grammar,
75       matching, parser, parsing expression, parsing expression grammar,  push
76       down  automaton,  recursive descent, state, top-down parsing languages,
77       transducer
78

CATEGORY

80       Parsing and Grammars
81
83       Copyright (c) 2009 Andreas Kupries <andreas_kupries@users.sourceforge.net>
84
85
86
87
88tcllib                                1.1                          pt::util(n)
Impressum