• Skip to content
  • Skip to link menu
Trinity API Reference
  • Trinity API Reference
  • KDevelop QMake parser
 

KDevelop QMake parser

  • buildtools
  • lib
  • parsers
  • qmake
location.h
Go to the documentation of this file.
1/* A Bison parser, made by GNU Bison 2.3. */
2
3/* Locations for Bison parsers in C++
4
5 Copyright (C) 2002, 2003, 2004, 2005, 2006 Free Software Foundation, Inc.
6
7 This program is free software; you can redistribute it and/or modify
8 it under the terms of the GNU General Public License as published by
9 the Free Software Foundation; either version 2, or (at your option)
10 any later version.
11
12 This program is distributed in the hope that it will be useful,
13 but WITHOUT ANY WARRANTY; without even the implied warranty of
14 MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
15 GNU General Public License for more details.
16
17 You should have received a copy of the GNU General Public License
18 along with this program; if not, write to the Free Software
19 Foundation, Inc., 51 Franklin Street, Fifth Floor,
20 Boston, MA 02110-1301, USA. */
21
22/* As a special exception, you may create a larger work that contains
23 part or all of the Bison parser skeleton and distribute that work
24 under terms of your choice, so long as that work isn't itself a
25 parser generator using the skeleton or a modified version thereof
26 as a parser skeleton. Alternatively, if you modify or redistribute
27 the parser skeleton itself, you may (at your option) remove this
28 special exception, which will cause the skeleton and the resulting
29 Bison output files to be licensed under the GNU General Public
30 License without this special exception.
31
32 This special exception was added by the Free Software Foundation in
33 version 2.2 of Bison. */
34
40#ifndef BISON_LOCATION_H
41# define BISON_LOCATION_H
42
43# include <iostream>
44# include <string>
45# include "position.h"
46
47namespace TQMake
48{
49
51 class location
52 {
53 public:
54
56 location ()
57 : begin (), end ()
58 {
59 }
60
61
63 inline void initialize (std::string* fn)
64 {
65 begin.initialize (fn);
66 end = begin;
67 }
68
71 public:
73 inline void step ()
74 {
75 begin = end;
76 }
77
79 inline void columns (unsigned int count = 1)
80 {
81 end += count;
82 }
83
85 inline void lines (unsigned int count = 1)
86 {
87 end.lines (count);
88 }
92 public:
94 position begin;
96 position end;
97 };
98
100 inline const location operator+ (const location& begin, const location& end)
101 {
102 location res = begin;
103 res.end = end.end;
104 return res;
105 }
106
108 inline const location operator+ (const location& begin, unsigned int width)
109 {
110 location res = begin;
111 res.columns (width);
112 return res;
113 }
114
116 inline location& operator+= (location& res, unsigned int width)
117 {
118 res.columns (width);
119 return res;
120 }
121
128 inline std::ostream& operator<< (std::ostream& ostr, const location& loc)
129 {
130 position last = loc.end - 1;
131 ostr << loc.begin;
132 if (last.filename
133 && (!loc.begin.filename
134 || *loc.begin.filename != *last.filename))
135 ostr << '-' << last;
136 else if (loc.begin.line != last.line)
137 ostr << '-' << last.line << '.' << last.column;
138 else if (loc.begin.column != last.column)
139 ostr << '-' << last.column;
140 return ostr;
141 }
142
143}
144
145#endif // not BISON_LOCATION_H
TQMake::location
Abstract a location.
Definition location.h:52
TQMake::location::step
void step()
Reset initial location to final location.
Definition location.h:73
TQMake::location::lines
void lines(unsigned int count=1)
Extend the current location to the COUNT next lines.
Definition location.h:85
TQMake::location::columns
void columns(unsigned int count=1)
Extend the current location to the COUNT next columns.
Definition location.h:79
TQMake::location::initialize
void initialize(std::string *fn)
Initialization.
Definition location.h:63
TQMake::location::begin
position begin
Beginning of the located region.
Definition location.h:94
TQMake::location::end
position end
End of the located region.
Definition location.h:96
TQMake::location::location
location()
Construct a location.
Definition location.h:56
TQMake::position
Abstract a position.
Definition position.h:50
TQMake::position::column
unsigned int column
Current column number.
Definition position.h:96
TQMake::position::filename
std::string * filename
File name to which this position refers.
Definition position.h:92
TQMake::position::line
unsigned int line
Current line number.
Definition position.h:94
TQMake::position::initialize
void initialize(std::string *fn)
Initialization.
Definition position.h:61
TQMake::position::lines
void lines(int count=1)
(line related) Advance to the COUNT next lines.
Definition position.h:72
position.h
Define the TQMake::position class.

KDevelop QMake parser

Skip menu "KDevelop QMake parser"
  • Main Page
  • Class Hierarchy
  • Alphabetical List
  • Class List
  • File List
  • Class Members

KDevelop QMake parser

Skip menu "KDevelop QMake parser"
  • buildtools
  •   lib
  •     base
  •     parsers
  •       autotools
  •       qmake
  •     widgets
  •   api
  • languages
  •   lib
  •     debugger
  •     designer_integration
  •     interfaces
  • lib
  •   catalog
  •   interfaces
  •     extensions
  •     external
  •     extras
  •   util
  •   widgets
  •     propeditor
  • parts
  •   documentation
  •     interfaces
  • src
  •   profileengine
  •     lib
Generated for KDevelop QMake parser by doxygen 1.9.8
This website is maintained by Timothy Pearson.