aboutsummaryrefslogtreecommitdiff
path: root/src/include/sexpr.H
diff options
context:
space:
mode:
authordos-reis <gdr@axiomatics.org>2014-11-16 20:32:55 +0000
committerdos-reis <gdr@axiomatics.org>2014-11-16 20:32:55 +0000
commit452696064e43c23f2a44edcded311f3d7b466d7e (patch)
tree375ea3690ca7ea469675313cae728a670dd26b09 /src/include/sexpr.H
parent564aff97f80abac84be64552f5238903cb126c33 (diff)
downloadopen-axiom-452696064e43c23f2a44edcded311f3d7b466d7e.tar.gz
Check for LLVM framework
Diffstat (limited to 'src/include/sexpr.H')
-rw-r--r--src/include/sexpr.H17
1 files changed, 13 insertions, 4 deletions
diff --git a/src/include/sexpr.H b/src/include/sexpr.H
index d3dafcb7..82dba2a3 100644
--- a/src/include/sexpr.H
+++ b/src/include/sexpr.H
@@ -146,6 +146,10 @@ namespace OpenAxiom {
};
SymbolSyntax(const Lexeme&, Kind);
Kind kind() const { return sort; }
+ const Byte* begin() const { return lexeme().begin(); }
+ const Byte* end() const { return lexeme().end(); }
+ std::size_t size() const { return lexeme().size(); }
+ Byte operator[](std::size_t i) const { return begin()[i]; }
void accept(Visitor&) const;
private:
const Kind sort;
@@ -386,19 +390,24 @@ namespace OpenAxiom {
};
// -- Reader --
+ struct RawInput {
+ const Byte* start;
+ const Byte* end;
+ Ordinal lineno;
+ };
+
struct Reader {
struct State {
- const Byte* start;
- const Byte* end;
+ RawInput bytes;
const Byte* cur;
const Byte* line;
- Ordinal lineno;
Allocator alloc;
};
+ explicit Reader(const RawInput&);
Reader(const Byte*, const Byte*);
const Byte* position(Ordinal);
- bool at_start() const { return st.cur == st.start; }
+ bool at_start() const { return st.cur == st.bytes.start; }
const Syntax* read();
private:
State st;