From 8cde489ab6c4169fb03d810447c18eea0d0eaa14 Mon Sep 17 00:00:00 2001 From: Alex Merry Date: Sat, 23 Mar 2013 03:30:19 +0000 Subject: Make the parser/lexer reentrant No more locking! Also, the interface for TikzGraphAssembler is much simpler. Changes to OSX code are completely untested. --- tikzit/src/common/TikzGraphAssembler.h | 23 +++++++++-------------- 1 file changed, 9 insertions(+), 14 deletions(-) (limited to 'tikzit/src/common/TikzGraphAssembler.h') diff --git a/tikzit/src/common/TikzGraphAssembler.h b/tikzit/src/common/TikzGraphAssembler.h index 3fc4e9e..16fdf7f 100644 --- a/tikzit/src/common/TikzGraphAssembler.h +++ b/tikzit/src/common/TikzGraphAssembler.h @@ -26,24 +26,19 @@ @interface TikzGraphAssembler : NSObject { Graph *graph; + void *scanner; NSMutableDictionary *nodeMap; NSError *lastError; + char linebuff[500]; + int lineno; + size_t tokenpos; } -@property (readonly) Graph *graph; -@property (readonly) NSError *lastError; - -- (BOOL)parseTikz:(NSString*)tikz; -- (BOOL)parseTikz:(NSString*)tikz forGraph:(Graph*)gr; - -- (BOOL)testTikz:(NSString*)tikz; - -- (void)invalidate; -- (void)invalidateWithError:(NSError*)error; - -+ (void)setup; -+ (TikzGraphAssembler*)currentAssembler; -+ (TikzGraphAssembler*)assembler; ++ (BOOL) parseTikz:(NSString*)tikz forGraph:(Graph*)gr error:(NSError**)e; ++ (BOOL) parseTikz:(NSString*)tikz forGraph:(Graph*)gr; ++ (Graph*) parseTikz:(NSString*)tikz error:(NSError**)e; ++ (Graph*) parseTikz:(NSString*)tikz; ++ (BOOL)validateTikzPropertyNameOrValue:(NSString*)tikz; @end -- cgit v1.2.3