summaryrefslogtreecommitdiff
path: root/tikzit/src/common/tikzparser.ym
diff options
context:
space:
mode:
authorAlex Merry <dev@randomguy3.me.uk>2013-08-28 12:33:02 +0100
committerAlex Merry <dev@randomguy3.me.uk>2013-08-28 12:33:37 +0100
commit718147147b832f5b5beebda9007b221d622d6bc4 (patch)
tree22b3d4e3e81240a6a160401fdcbf21497ee4af90 /tikzit/src/common/tikzparser.ym
parent0f8c707a69c3bb6d11798866975aac4976e4c22b (diff)
Make tikzparser.ym compatible with bison 2.3
Diffstat (limited to 'tikzit/src/common/tikzparser.ym')
-rw-r--r--tikzit/src/common/tikzparser.ym25
1 files changed, 6 insertions, 19 deletions
diff --git a/tikzit/src/common/tikzparser.ym b/tikzit/src/common/tikzparser.ym
index bf33aa9..a6dc1ee 100644
--- a/tikzit/src/common/tikzparser.ym
+++ b/tikzit/src/common/tikzparser.ym
@@ -18,16 +18,18 @@
* You should have received a copy of the GNU General Public License
* along with this program. If not, see <http://www.gnu.org/licenses/>.
*/
+
+#import "tikzparserdefs.h"
%}
/* we use features added to bison 2.4 */
-%require "2.4"
+%require "2.3"
%error-verbose
/* enable maintaining locations for better error messages */
%locations
/* the name of the header file */
-%defines "common/tikzparser.h"
+/*%defines "common/tikzparser.h"*/
/* make it re-entrant (no global variables) */
%pure-parser
/* We use a pure (re-entrant) lexer. This means yylex
@@ -37,21 +39,6 @@
that lexer state as an argument */
%parse-param {void *scanner}
-/* things required to use the parser (will go in the header);
- in particular, declarations/imports for types in the %union
- must go here */
-%code requires {
-#import <Foundation/Foundation.h>
-@class TikzGraphAssembler;
-@class GraphElementData;
-@class GraphElementProperty;
-@class Node;
-struct noderef {
- Node *node;
- NSString *anchor;
-};
-}
-
/* possible data types for semantic values */
%union {
NSPoint pt;
@@ -62,7 +49,7 @@ struct noderef {
struct noderef noderef;
}
-%code {
+%{
#import "GraphElementData.h"
#import "GraphElementProperty.h"
#import "Node.h"
@@ -78,7 +65,7 @@ struct noderef {
void yyerror(YYLTYPE *yylloc, void *scanner, const char *str) {
[assembler reportError:str atLocation:yylloc];
}
-}
+%}
/* yyloc is set up with first_column = last_column = 1 by default;
however, it makes more sense to think of us being "before the