/*
- * Copyright 2001-2007 Adrian Thurston <thurston@cs.queensu.ca>
+ * Copyright 2001-2007 Adrian Thurston <thurston@complang.org>
*/
/* This file is part of Ragel.
#include <string>
#include "vector.h"
#include "config.h"
+#include "common.h"
#define PROGNAME "ragel"
+/* Target output style. */
+enum CodeStyle
+{
+ GenTables,
+ GenFTables,
+ GenFlat,
+ GenFFlat,
+ GenGoto,
+ GenFGoto,
+ GenIpGoto,
+ GenSplit
+};
+
/* To what degree are machine minimized. */
enum MinimizeLevel {
MinimizeApprox,
MinimizeEveryOp
};
+/* Target implementation */
+enum RubyImplEnum
+{
+ MRI,
+ Rubinius
+};
+
/* Options. */
extern MinimizeLevel minimizeLevel;
extern MinimizeOpt minimizeOpt;
-extern char *machineSpec, *machineName;
+extern const char *machineSpec, *machineName;
extern bool printStatistics;
extern bool wantDupsRemoved;
+extern bool generateDot;
+extern bool generateXML;
+extern RubyImplEnum rubyImpl;
/* Error reporting format. */
enum ErrorFormat {
extern int gblErrorCount;
extern char mainMachine[];
-/* Location in an input file. */
-struct InputLoc
-{
- const char *fileName;
- int line;
- int col;
-};
-
InputLoc makeInputLoc( const char *fileName, int line = 0, int col = 0 );
std::ostream &operator<<( std::ostream &out, const InputLoc &loc );
std::ostream &error( const InputLoc &loc );
std::ostream &warning( const InputLoc &loc );
-void terminateAllParsers( );
-void writeMachines( std::ostream &out, std::string hostData, char *inputFileName );
+struct XmlParser;
+
void xmlEscapeHost( std::ostream &out, char *data, long len );
-typedef Vector<const char *> ArgsVector;
-extern ArgsVector includePaths;
+extern CodeStyle codeStyle;
+
+/* IO filenames and stream. */
+extern bool displayPrintables;
+extern int gblErrorCount;
+
+/* Options. */
+extern int numSplitPartitions;
+extern bool noLineDirectives;
+
+std::ostream &error();
+
+/* Target language and output style. */
+extern CodeStyle codeStyle;
+
+extern int numSplitPartitions;
+extern bool noLineDirectives;
-#endif /* _RAGEL_H */
+#endif