sapphirec  0.1
The Sapphire compiler.
Normalizer.h
1 #pragma once
2 #include "Lexer.h" // for TokenStream
3 #include "Token.h"
4 
5 /* Namespace to normalize a TokenStream. */
6 namespace Normalizer
7 {
8 /* Some tokens are difficult for the Lexer to parse right, or maybe I'm just lazy.
9 Anyways, this function transforms > and = tokens next to each other into a single >=, which has a different meaning,
10 etc... For example: = + = : ==, < + = : <=...
11 
12 It also takes blank tokens and removes them. */
13 TokenStream normalize(const TokenStream& input);
14 } // namespace Normalizer