summaryrefslogtreecommitdiff
path: root/Userland/Libraries/LibSQL/AST/SyntaxHighlighter.h
diff options
context:
space:
mode:
authorJan de Visser <jan@de-visser.net>2021-06-21 10:57:44 -0400
committerAndreas Kling <kling@serenityos.org>2021-06-24 00:36:53 +0200
commit4198f7e1af7997e0615891289194752f1375f5a1 (patch)
treeecea66688f05bb6304ddb6b7c5fe27ec2f57cfe3 /Userland/Libraries/LibSQL/AST/SyntaxHighlighter.h
parente0f1c237d21be3e2831092319f50bb429ad1f7a9 (diff)
downloadserenity-4198f7e1af7997e0615891289194752f1375f5a1.zip
LibSQL: Move Lexer and Parser machinery to AST directory
The SQL engine is expected to be a fairly sizeable piece of software. Therefore we're starting to restructure the codebase for growth.
Diffstat (limited to 'Userland/Libraries/LibSQL/AST/SyntaxHighlighter.h')
-rw-r--r--Userland/Libraries/LibSQL/AST/SyntaxHighlighter.h28
1 files changed, 28 insertions, 0 deletions
diff --git a/Userland/Libraries/LibSQL/AST/SyntaxHighlighter.h b/Userland/Libraries/LibSQL/AST/SyntaxHighlighter.h
new file mode 100644
index 0000000000..981b5b8091
--- /dev/null
+++ b/Userland/Libraries/LibSQL/AST/SyntaxHighlighter.h
@@ -0,0 +1,28 @@
+/*
+ * Copyright (c) 2021, Dylan Katz <dykatz@uw.edu>
+ *
+ * SPDX-License-Identifier: BSD-2-Clause
+ */
+
+#pragma once
+
+#include <LibSyntax/Highlighter.h>
+
+namespace SQL::AST {
+
+class SyntaxHighlighter final : public Syntax::Highlighter {
+public:
+ SyntaxHighlighter() { }
+ virtual ~SyntaxHighlighter() override;
+
+ virtual bool is_identifier(u64) const override;
+
+ virtual Syntax::Language language() const override { return Syntax::Language::SQL; }
+ virtual void rehighlight(Palette const&) override;
+
+protected:
+ virtual Vector<MatchingTokenPair> matching_token_pairs_impl() const override;
+ virtual bool token_types_equal(u64, u64) const override;
+};
+
+}