1LaTeXML::Common::LocatoUrs(e3r)Contributed Perl DocumentLaatTieoXnML::Common::Locator(3)
2
3
4

NAME

6       "LaTeXML::Common::Locator" - represents a reference to a point or range
7       in the source file.
8

DESCRIPTION

10       "LaTeXML::Common::Locator" contains a reference to a point or range
11       within a source file.  This data structure is intended to be used both
12       programtically (for "source references") and to display error messages
13       to the user.
14
15       It extends LaTeXML::Common::Object.
16
17   Locator Creation
18       "$locator = LaTeXML::Common::Locator->new($source, $fromLine, $fromCol,
19       $toLine, $toCol);"
20           Creates a new locator. $source should be a string containing the
21           full path of the source file, an empty string in case of a literal
22           string, or undef in case of an anonymous string. $fromLine and
23           $fromCol should be integers containing the line and column numbers
24           of the start of the range in the source file, or undef if unknown.
25           $toLine and $toCol should be the integers containing the line and
26           column numbers of the end of the range, or undef if a point is
27           being refered to.
28
29       "$locator = LaTeXML::Common::Locator->newRange($from, $to);"
30           Creates a new locator, starting at the locator $from and ending at
31           the locator $to. Either locator may be undef, in which case the
32           other one is returned.
33
34   Methods
35       "$str = $locator->toString;"
36           Turns this locator into a short string for output in user messages.
37
38       "$str = $locator->stringify;"
39           Turns this locator into a long string, including the full filename
40           of the input.
41
42       "$attr = $locator->toAttribute;"
43           Turns this locator into an XPointer expression, for usage within an
44           XML attribute.
45
46       "$isRange = $locator->isRange;"
47           Checks if this locator points to a range or a point.
48
49       "$source = $locator->getShortSource($stringSource);"
50           Gets a short string refering to the source of this locator.
51           $stringSource will be used if the source refers to an anonymous or
52           literal string input.
53
54       "$from = $locator->getFromLocator;"
55           Gets a locator pointing to the first point in the range of this
56           locator.  Works for both point and range locators.
57
58       "$from = $locator->getToLocator;"
59           Gets a locator pointing to the last point in the range of this
60           locator.  Does not work for point locators.
61

AUTHOR

63       Bruce Miller <bruce.miller@nist.gov> Tom Wiesing
64       <tom.wiesing@gmail.com>
65
67       Public domain software, produced as part of work done by the United
68       States Government & not subject to copyright in the US.
69
70
71
72perl v5.36.0                      2022-07-20       LaTeXML::Common::Locator(3)
Impressum