anchor.diff:  // Lexer
   
   // Basic keywords (from https://msdn.microsoft.com/en-us/library/ms189822.aspx)
  -ADD:                             A D D;
  -ALL:                             A L L;
  -ALTER:                           A L T E R;
  -AND:                             A N D;
  -ANY:                             A N Y;
  -AS:                              A S;
  -ASC:                             A S C;
  -AUTHORIZATION:                   A U T H O R I Z A T I O N;
  -BACKUP:                          B A C K U P;
  -BEGIN:                           B E G I N;
  -BETWEEN:                         B E T W E E N;
  -BREAK:                           B R E A K;
  -BROWSE:                          B R O W S E;
  -BULK:                            B U L K;
  -BY:                              B Y;
  -CASCADE:                         C A S C A D E;
  -CASE:                            C A S E;
  -CHECK:                           C H E C K;
  -CHECKPOINT:                      C H E C K P O I N T;
  -CLOSE:                           C L O S E;
  -CLUSTERED:                       C L U S T E R E D;
  -COALESCE:                        C O A L E S C E;
  -COLLATE:                         C O L L A T E;
  -COLUMN:                          C O L U M N;
  -COMMIT:                          C O M M I T;
  -COMPUTE:                         C O M P U T E;
  -CONSTRAINT:                      C O N S T R A I N T;
  -CONTAINS:                        C O N T A I N S;
  -CONTAINSTABLE:                   C O N T A I N S T A B L E;
  -CONTINUE:                        C O N T I N U E;
  -CONVERT:                         C O N V E R T;
  -CREATE:                          C R E A T E;
  -CROSS:                           C R O S S;
  -CURRENT:                         C U R R E N T;
  -CURRENT_DATE:                    C U R R E N T '_' D A T E;
  -CURRENT_TIME:                    C U R R E N T '_' T I M E;
  -CURRENT_TIMESTAMP:               C U R R E N T '_' T I M E S T A M P;
  -CURRENT_USER:                    C U R R E N T '_' U S E R;
  -CURSOR:                          C U R S O R;
  -DATABASE:                        D A T A B A S E;
  -DBCC:                            D B C C;
  -DEALLOCATE:                      D E A L L O C A T E;
  -DECLARE:                         D E C L A R E;
  -DEFAULT:                         D E F A U L T;
  -DELETE:                          D E L E T E;
  -DENY:                            D E N Y;
  -DESC:                            D E S C;
  -DISK:                            D I S K;
  -DISTINCT:                        D I S T I N C T;
  -DISTRIBUTED:                     D I S T R I B U T E D;
  -DOUBLE:                          D O U B L E;
  -DROP:                            D R O P;
  -DUMP:                            D U M P;
  -ELSE:                            E L S E;
  -END:                             E N D;
  -ERRLVL:                          E R R L V L;
  -ESCAPE:                          E S C A P E;
  -EXCEPT:                          E X C E P T;
  -EXEC:                            E X E C;
  -EXECUTE:                         E X E C U T E;
  -EXISTS:                          E X I S T S;
  -EXIT:                            E X I T;
  -EXTERNAL:                        E X T E R N A L;
  -FETCH:                           F E T C H;
  -FILE:                            F I L E;
  -FILLFACTOR:                      F I L L F A C T O R;
  -FOR:                             F O R;
  -FORCESEEK:                       F O R C E S E E K;
  -FOREIGN:                         F O R E I G N;
  -FREETEXT:                        F R E E T E X T;
  -FREETEXTTABLE:                   F R E E T E X T T A B L E;
  -FROM:                            F R O M;
  -FULL:                            F U L L;
  -FUNCTION:                        F U N C T I O N;
  -GOTO:                            G O T O;
  -GRANT:                           G R A N T;
  -GROUP:                           G R O U P;
  -HAVING:                          H A V I N G;
  -IDENTITY:                        I D E N T I T Y;
  -IDENTITYCOL:                     I D E N T I T Y C O L;
  -IDENTITY_INSERT:                 I D E N T I T Y '_' I N S E R T;
  -IF:                              I F;
  -IN:                              I N;
  -INDEX:                           I N D E X;
  -INNER:                           I N N E R;
  -INSERT:                          I N S E R T;
  -INTERSECT:                       I N T E R S E C T;
  -INTO:                            I N T O;
  -IS:                              I S;
  -JOIN:                            J O I N;
  -KEY:                             K E Y;
  -KILL:                            K I L L;
  -LEFT:                            L E F T;
  -LIKE:                            L I K E;
  -LINENO:                          L I N E N O;
  -LOAD:                            L O A D;
  -MERGE:                           M E R G E;
  -NATIONAL:                        N A T I O N A L;
  -NOCHECK:                         N O C H E C K;
  -NONCLUSTERED:                    N O N C L U S T E R E D;
  -NOT:                             N O T;
  -NULL:                            N U L L;
  -NULLIF:                          N U L L I F;
  -OF:                              O F;
  -OFF:                             O F F;
  -OFFSETS:                         O F F S E T S;
  -ON:                              O N;
  -OPEN:                            O P E N;
  -OPENDATASOURCE:                  O P E N D A T A S O U R C E;
  -OPENQUERY:                       O P E N Q U E R Y;
  -OPENROWSET:                      O P E N R O W S E T;
  -OPENXML:                         O P E N X M L;
  -OPTION:                          O P T I O N;
  -OR:                              O R;
  -ORDER:                           O R D E R;
  -OUTER:                           O U T E R;
  -OVER:                            O V E R;
  -PERCENT:                         P E R C E N T;
  -PIVOT:                           P I V O T;
  -PLAN:                            P L A N;
  -PRECISION:                       P R E C I S I O N;
  -PRIMARY:                         P R I M A R Y;
  -PRINT:                           P R I N T;
  -PROC:                            P R O C;
  -PROCEDURE:                       P R O C E D U R E;
  -PUBLIC:                          P U B L I C;
  -RAISERROR:                       R A I S E R R O R;
  -READ:                            R E A D;
  -READTEXT:                        R E A D T E X T;
  -RECONFIGURE:                     R E C O N F I G U R E;
  -REFERENCES:                      R E F E R E N C E S;
  -REPLICATION:                     R E P L I C A T I O N;
  -RESTORE:                         R E S T O R E;
  -RESTRICT:                        R E S T R I C T;
  -RETURN:                          R E T U R N;
  -REVERT:                          R E V E R T;
  -REVOKE:                          R E V O K E;
  -RIGHT:                           R I G H T;
  -ROLLBACK:                        R O L L B A C K;
  -ROWCOUNT:                        R O W C O U N T;
  -ROWGUIDCOL:                      R O W G U I D C O L;
  -RULE:                            R U L E;
  -SAVE:                            S A V E;
  -SCHEMA:                          S C H E M A;
  -SECURITYAUDIT:                   S E C U R I T Y A U D I T;
  -SELECT:                          S E L E C T;
  -SEMANTICKEYPHRASETABLE:          S E M A N T I C K E Y P H R A S E T A B L E;
  -SEMANTICSIMILARITYDETAILSTABLE:  S E M A N T I C S I M I L A R I T Y D E T A I L S T A B L E;
  -SEMANTICSIMILARITYTABLE:         S E M A N T I C S I M I L A R I T Y T A B L E;
  -SESSION_USER:                    S E S S I O N '_' U S E R;
  -SET:                             S E T;
  -SETUSER:                         S E T U S E R;
  -SHUTDOWN:                        S H U T D O W N;
  -SOME:                            S O M E;
  -STATISTICS:                      S T A T I S T I C S;
  -SYSTEM_USER:                     S Y S T E M '_' U S E R;
  -TABLE:                           T A B L E;
  -TABLESAMPLE:                     T A B L E S A M P L E;
  -TEXTSIZE:                        T E X T S I Z E;
  -THEN:                            T H E N;
  -TO:                              T O;
  -TOP:                             T O P;
  -TRAN:                            T R A N;
  -TRANSACTION:                     T R A N S A C T I O N;
  -TRIGGER:                         T R I G G E R;
  -TRUNCATE:                        T R U N C A T E;
  -TRY_CONVERT:                     T R Y '_' C O N V E R T;
  -TSEQUAL:                         T S E Q U A L;
  -UNION:                           U N I O N;
  -UNIQUE:                          U N I Q U E;
  -UNPIVOT:                         U N P I V O T;
  -UPDATE:                          U P D A T E;
  -UPDATETEXT:                      U P D A T E T E X T;
  -USE:                             U S E;
  -USER:                            U S E R;
  -VALUES:                          V A L U E S;
  -VARYING:                         V A R Y I N G;
  -VIEW:                            V I E W;
  -WAITFOR:                         W A I T F O R;
  -WHEN:                            W H E N;
  -WHERE:                           W H E R E;
  -WHILE:                           W H I L E;
  -WITH:                            W I T H;
  -WITHIN:                          W I T H I N;
  -WRITETEXT:                       W R I T E T E X T;
  +ADD:                                   A D D;
  +ALL:                                   A L L;
  +ALTER:                                 A L T E R;
  +AND:                                   A N D;
  +ANY:                                   A N Y;
  +AS:                                    A S;
  +ASC:                                   A S C;
  +AUTHORIZATION:                         A U T H O R I Z A T I O N;
  +BACKUP:                                B A C K U P;
  +BEGIN:                                 B E G I N;
  +BETWEEN:                               B E T W E E N;
  +BREAK:                                 B R E A K;
  +BROWSE:                                B R O W S E;
  +BULK:                                  B U L K;
  +BY:                                    B Y;
  +CASCADE:                               C A S C A D E;
  +CASE:                                  C A S E;
  +CHANGETABLE:                           C H A N G E T A B L E;
  +CHANGES:                               C H A N G E S; 
  +CHECK:                                 C H E C K;
  +CHECKPOINT:                            C H E C K P O I N T;
  +CLOSE:                                 C L O S E;
  +CLUSTERED:                             C L U S T E R E D;
  +COALESCE:                              C O A L E S C E;
  +COLLATE:                               C O L L A T E;
  +COLUMN:                                C O L U M N;
  +COMMIT:                                C O M M I T;
  +COMPUTE:                               C O M P U T E;
  +CONSTRAINT:                            C O N S T R A I N T;
  +CONTAINS:                              C O N T A I N S;
  +CONTAINSTABLE:                         C O N T A I N S T A B L E;
  +CONTINUE:                              C O N T I N U E;
  +CONVERT:                               C O N V E R T;
  +CREATE:                                C R E A T E;
  +CROSS:                                 C R O S S;
  +CURRENT:                               C U R R E N T;
  +CURRENT_DATE:                          C U R R E N T '_' D A T E;
  +CURRENT_TIME:                          C U R R E N T '_' T I M E;
  +CURRENT_TIMESTAMP:                     C U R R E N T '_' T I M E S T A M P;
  +CURRENT_USER:                          C U R R E N T '_' U S E R;
  +CURSOR:                                C U R S O R;
  +DATABASE:                              D A T A B A S E;
  +DBCC:                                  D B C C;
  +DEALLOCATE:                            D E A L L O C A T E;
  +DECLARE:                               D E C L A R E;
  +DEFAULT:                               D E F A U L T;
  +DELETE:                                D E L E T E;
  +DENY:                                  D E N Y;
  +DESC:                                  D E S C;
  +DISK:                                  D I S K;
  +DISTINCT:                              D I S T I N C T;
  +DISTRIBUTED:                           D I S T R I B U T E D;
  +DOUBLE:                                D O U B L E;
  +DROP:                                  D R O P;
  +DUMP:                                  D U M P;
  +ELSE:                                  E L S E;
  +END:                                   E N D;
  +ERRLVL:                                E R R L V L;
  +ESCAPE:                                E S C A P E;
  +EXCEPT:                                E X C E P T;
  +EXEC:                                  E X E C;
  +EXECUTE:                               E X E C U T E;
  +EXISTS:                                E X I S T S;
  +EXIT:                                  E X I T;
  +EXTERNAL:                              E X T E R N A L;
  +FETCH:                                 F E T C H;
  +FILE:                                  F I L E;
  +FILLFACTOR:                            F I L L F A C T O R;
  +FOR:                                   F O R;
  +FORCESEEK:                             F O R C E S E E K;
  +FOREIGN:                               F O R E I G N;
  +FREETEXT:                              F R E E T E X T;
  +FREETEXTTABLE:                         F R E E T E X T T A B L E;
  +FROM:                                  F R O M;
  +FULL:                                  F U L L;
  +FUNCTION:                              F U N C T I O N;
  +GOTO:                                  G O T O;
  +GRANT:                                 G R A N T;
  +GROUP:                                 G R O U P;
  +HAVING:                                H A V I N G;
  +IDENTITY:                              I D E N T I T Y;
  +IDENTITYCOL:                           I D E N T I T Y C O L;
  +IDENTITY_INSERT:                       I D E N T I T Y '_' I N S E R T;
  +IF:                                    I F;
  +IN:                                    I N;
  +INDEX:                                 I N D E X;
  +INNER:                                 I N N E R;
  +INSERT:                                I N S E R T;
  +INTERSECT:                             I N T E R S E C T;
  +INTO:                                  I N T O;
  +IS:                                    I S;
  +JOIN:                                  J O I N;
  +KEY:                                   K E Y;
  +KILL:                                  K I L L;
  +LEFT:                                  L E F T;
  +LIKE:                                  L I K E;
  +LINENO:                                L I N E N O;
  +LOAD:                                  L O A D;
  +MERGE:                                 M E R G E;
  +NATIONAL:                              N A T I O N A L;
  +NOCHECK:                               N O C H E C K;
  +NONCLUSTERED:                          N O N C L U S T E R E D;
  +NOT:                                   N O T;
  +NULL:                                  N U L L;
  +NULLIF:                                N U L L I F;
  +OF:                                    O F;
  +OFF:                                   O F F;
  +OFFSETS:                               O F F S E T S;
  +ON:                                    O N;
  +OPEN:                                  O P E N;
  +OPENDATASOURCE:                        O P E N D A T A S O U R C E;
  +OPENQUERY:                             O P E N Q U E R Y;
  +OPENROWSET:                            O P E N R O W S E T;
  +OPENXML:                               O P E N X M L;
  +OPTION:                                O P T I O N;
  +OR:                                    O R;
  +ORDER:                                 O R D E R;
  +OUTER:                                 O U T E R;
  +OVER:                                  O V E R;
  +PERCENT:                               P E R C E N T;
  +PIVOT:                                 P I V O T;
  +PLAN:                                  P L A N;
  +PRECISION:                             P R E C I S I O N;
  +PRIMARY:                               P R I M A R Y;
  +PRINT:                                 P R I N T;
  +PROC:                                  P R O C;
  +PROCEDURE:                             P R O C E D U R E;
  +PUBLIC:                                P U B L I C;
  +RAISERROR:                             R A I S E R R O R;
  +READ:                                  R E A D;
  +READTEXT:                              R E A D T E X T;
  +RECONFIGURE:                           R E C O N F I G U R E;
  +REFERENCES:                            R E F E R E N C E S;
  +REPLICATION:                           R E P L I C A T I O N;
  +RESTORE:                               R E S T O R E;
  +RESTRICT:                              R E S T R I C T;
  +RETURN:                                R E T U R N;
  +REVERT:                                R E V E R T;
  +REVOKE:                                R E V O K E;
  +RIGHT:                                 R I G H T;
  +ROLLBACK:                              R O L L B A C K;
  +ROWCOUNT:                              R O W C O U N T;
  +ROWGUIDCOL:                            R O W G U I D C O L;
  +RULE:                                  R U L E;
  +SAVE:                                  S A V E;
  +SCHEMA:                                S C H E M A;
  +SECURITYAUDIT:                         S E C U R I T Y A U D I T;
  +SELECT:                                S E L E C T;
  +SEMANTICKEYPHRASETABLE:                S E M A N T I C K E Y P H R A S E T A B L E;
  +SEMANTICSIMILARITYDETAILSTABLE:        S E M A N T I C S I M I L A R I T Y D E T A I L S T A B L E;
  +SEMANTICSIMILARITYTABLE:               S E M A N T I C S I M I L A R I T Y T A B L E;
  +SESSION_USER:                          S E S S I O N '_' U S E R;
  +SET:                                   S E T;
  +SETUSER:                               S E T U S E R;
  +SHUTDOWN:                              S H U T D O W N;
  +SOME:                                  S O M E;
  +STATISTICS:                            S T A T I S T I C S;
  +SYSTEM_USER:                           S Y S T E M '_' U S E R;
  +TABLE:                                 T A B L E;
  +TABLESAMPLE:                           T A B L E S A M P L E;
  +TEXTSIZE:                              T E X T S I Z E;
  +THEN:                                  T H E N;
  +TO:                                    T O;
  +TOP:                                   T O P;
  +TRAN:                                  T R A N;
  +TRANSACTION:                           T R A N S A C T I O N;
  +TRIGGER:                               T R I G G E R;
  +TRUNCATE:                              T R U N C A T E;
  +TRY_CONVERT:                           T R Y '_' C O N V E R T;
  +TSEQUAL:                               T S E Q U A L;
  +UNION:                                 U N I O N;
  +UNIQUE:                                U N I Q U E;
  +UNPIVOT:                               U N P I V O T;
  +UPDATE:                                U P D A T E;
  +UPDATETEXT:                            U P D A T E T E X T;
  +USE:                                   U S E;
  +USER:                                  U S E R;
  +VALUES:                                V A L U E S;
  +VARYING:                               V A R Y I N G;
  +VIEW:                                  V I E W;
  +WAITFOR:                               W A I T F O R;
  +WHEN:                                  W H E N;
  +WHERE:                                 W H E R E;
  +WHILE:                                 W H I L E;
  +WITH:                                  W I T H;
  +WITHIN:                                W I T H I N;
  +WRITETEXT:                             W R I T E T E X T;
   
   // Additional keywords (they can be id).
  -ABSOLUTE:                        A B S O L U T E;
  -APPLY:                           A P P L Y;
  -AUTO:                            A U T O;
  -AVG:                             A V G;
  -BASE64:                          B A S E '64';
  -CALLER:                          C A L L E R;
  -CAST:                            C A S T;
  -CATCH:                           C A T C H;
  -CHECKSUM_AGG:                    C H E C K S U M '_' A G G;
  -COMMITTED:                       C O M M I T T E D;
  -CONCAT:                          C O N C A T;
  -COOKIE:                          C O O K I E;
  -COUNT:                           C O U N T;
  -COUNT_BIG:                       C O U N T '_' B I G;
  -DELAY:                           D E L A Y;
  -DELETED:                         D E L E T E D;
  -DENSE_RANK:                      D E N S E '_' R A N K;
  -DISABLE:                         D I S A B L E;
  -DYNAMIC:                         D Y N A M I C;
  -ENCRYPTION:                      E N C R Y P T I O N;
  -FAST:                            F A S T;
  -FAST_FORWARD:                    F A S T '_' F O R W A R D;
  -FIRST:                           F I R S T;
  -FOLLOWING:                       F O L L O W I N G;
  -FORWARD_ONLY:                    F O R W A R D '_' O N L Y;
  -FULLSCAN:                        F U L L S C A N;
  -GLOBAL:                          G L O B A L;
  -GO:                              G O;
  -GROUPING:                        G R O U P I N G;
  -GROUPING_ID:                     G R O U P I N G '_' I D;
  -HASH:                            H A S H;
  -INSENSITIVE:                     I N S E N S I T I V E;
  -INSERTED:                        I N S E R T E D;
  -ISOLATION:                       I S O L A T I O N;
  -KEEPFIXED:                       K E E P F I X E D;
  -KEYSET:                          K E Y S E T;
  -LAST:                            L A S T;
  -LEVEL:                           L E V E L;
  -LOCAL:                           L O C A L;
  -LOCK_ESCALATION:                 L O C K '_' E S C A L A T I O N;
  -LOGIN:                           L O G I N;
  -LOOP:                            L O O P;
  -MARK:                            M A R K;
  -MAX:                             M A X;
  -MIN:                             M I N;
  -MODIFY:                          M O D I F Y;
  -NEXT:                            N E X T;
  -NAME:                            N A M E;
  -NOCOUNT:                         N O C O U N T;
  -NOEXPAND:                        N O E X P A N D;
  -NORECOMPUTE:                     N O R E C O M P U T E;
  -NTILE:                           N T I L E;
  -NUMBER:                          N U M B E R;
  -OFFSET:                          O F F S E T;
  -ONLY:                            O N L Y;
  -OPTIMISTIC:                      O P T I M I S T I C;
  -OPTIMIZE:                        O P T I M I Z E;
  -OUT:                             O U T;
  -OUTPUT:                          O U T P U T;
  -OWNER:                           O W N E R;
  -PARTITION:                       P A R T I T I O N;
  -PATH:                            P A T H;
  -PRECEDING:                       P R E C E D I N G;
  -PRIOR:                           P R I O R;
  -RANGE:                           R A N G E;
  -RANK:                            R A N K;
  -READONLY:                        R E A D O N L Y;
  -READ_ONLY:                       R E A D '_' O N L Y;
  -RECOMPILE:                       R E C O M P I L E;
  -RELATIVE:                        R E L A T I V E;
  -REMOTE:                          R E M O T E;
  -REPEATABLE:                      R E P E A T A B L E;
  -ROOT:                            R O O T;
  -ROW:                             R O W;
  -ROWGUID:                         R O W G U I D;
  -ROWS:                            R O W S;
  -ROW_NUMBER:                      R O W '_' N U M B E R;
  -SAMPLE:                          S A M P L E;
  -SCHEMABINDING:                   S C H E M A B I N D I N G;
  -SCROLL:                          S C R O L L;
  -SCROLL_LOCKS:                    S C R O L L '_' L O C K S;
  -SELF:                            S E L F;
  -SERIALIZABLE:                    S E R I A L I Z A B L E;
  -SNAPSHOT:                        S N A P S H O T;
  -SPATIAL_WINDOW_MAX_CELLS:        S P A T I A L '_' W I N D O W '_' M A X '_' C E L L S;
  -STATIC:                          S T A T I C;
  -STATS_STREAM:                    S T A T S '_' S T R E A M;
  -STDEV:                           S T D E V;
  -STDEVP:                          S T D E V P;
  -SUM:                             S U M;
  -THROW:                           T H R O W;
  -TIES:                            T I E S;
  -TIME:                            T I M E;
  -TRY:                             T R Y;
  -TYPE:                            T Y P E;
  -TYPE_WARNING:                    T Y P E '_' W A R N I N G;
  -UNBOUNDED:                       U N B O U N D E D;
  -UNCOMMITTED:                     U N C O M M I T T E D;
  -UNKNOWN:                         U N K N O W N;
  -USING:                           U S I N G;
  -VAR:                             V A R;
  -VARP:                            V A R P;
  -VIEW_METADATA:                   V I E W '_' M E T A D A T A;
  -WORK:                            W O R K;
  -XML:                             X M L;
  -XMLNAMESPACES:                   X M L N A M E S P A C E S;
  -
  -DOLLAR_ACTION:                   '$' A C T I O N;
  -
  -SPACE:              [ \t\r\n]+    -> channel(HIDDEN);
  +ABSOLUTE:                              A B S O L U T E;
  +APPLY:                                 A P P L Y;
  +AUTO:                                  A U T O;
  +AVG:                                   A V G;
  +BASE64:                                B A S E '64';
  +BINARY_CHECKSUM:                       B I N A R Y '_' C H E C K S U M;
  +CALLER:                                C A L L E R;
  +CAST:                                  C A S T;
  +CATCH:                                 C A T C H;
  +CHECKSUM:                              C H E C K S U M;
  +CHECKSUM_AGG:                          C H E C K S U M '_' A G G;
  +COMMITTED:                             C O M M I T T E D;
  +CONCAT:                                C O N C A T;
  +COOKIE:                                C O O K I E;
  +COUNT:                                 C O U N T;
  +COUNT_BIG:                             C O U N T '_' B I G;
  +DATEADD:                               D A T E A D D;
  +DATEDIFF:                              D A T E D I F F;
  +DATENAME:                              D A T E N A M E;
  +DATEPART:                              D A T E P A R T;
  +DELAY:                                 D E L A Y;
  +DELETED:                               D E L E T E D;
  +DENSE_RANK:                            D E N S E '_' R A N K;
  +DISABLE:                               D I S A B L E;
  +DYNAMIC:                               D Y N A M I C;
  +ENCRYPTION:                            E N C R Y P T I O N;
  +EXPAND:                                E X P A N D;
  +FAST:                                  F A S T;
  +FAST_FORWARD:                          F A S T '_' F O R W A R D;
  +FIRST:                                 F I R S T;
  +FORCE:                                 F O R C E;
  +FORCED:                                F O R C E D;
  +FOLLOWING:                             F O L L O W I N G;
  +FORWARD_ONLY:                          F O R W A R D '_' O N L Y;
  +FULLSCAN:                              F U L L S C A N;
  +GLOBAL:                                G L O B A L;
  +GO:                                    G O;
  +GROUPING:                              G R O U P I N G;
  +GROUPING_ID:                           G R O U P I N G '_' I D;
  +HASH:                                  H A S H;
  +INSENSITIVE:                           I N S E N S I T I V E;
  +INSERTED:                              I N S E R T E D;
  +ISOLATION:                             I S O L A T I O N;
  +KEEP:                                  K E E P;
  +KEEPFIXED:                             K E E P F I X E D;
  +IGNORE_NONCLUSTERED_COLUMNSTORE_INDEX: I G N O R E '_' N O N C L U S T E R E D '_' C O L U M N S T O R E '_' I N D E X;
  +KEYSET:                                K E Y S E T;
  +LAST:                                  L A S T;
  +LEVEL:                                 L E V E L;
  +LOCAL:                                 L O C A L;
  +LOCK_ESCALATION:                       L O C K '_' E S C A L A T I O N;
  +LOGIN:                                 L O G I N;
  +LOOP:                                  L O O P;
  +MARK:                                  M A R K;
  +MAX:                                   M A X;
  +MAXDOP:                                M A X D O P;
  +MAXRECURSION:                          M A X R E C U R S I O N;
  +MIN:                                   M I N;
  +MIN_ACTIVE_ROWVERSION:                 M I N '_' A C T I V E '_' R O W V E R S I O N;
  +MODIFY:                                M O D I F Y;
  +NEXT:                                  N E X T;
  +NAME:                                  N A M E;
  +NOCOUNT:                               N O C O U N T;
  +NOEXPAND:                              N O E X P A N D;
  +NORECOMPUTE:                           N O R E C O M P U T E;
  +NTILE:                                 N T I L E;
  +NUMBER:                                N U M B E R;
  +OFFSET:                                O F F S E T;
  +ONLY:                                  O N L Y;
  +OPTIMISTIC:                            O P T I M I S T I C;
  +OPTIMIZE:                              O P T I M I Z E;
  +OUT:                                   O U T;
  +OUTPUT:                                O U T P U T;
  +OWNER:                                 O W N E R;
  +PARAMETERIZATION:                      P A R A M E T E R I Z A T I O N;
  +PARTITION:                             P A R T I T I O N;
  +PATH:                                  P A T H;
  +PRECEDING:                             P R E C E D I N G;
  +PRIOR:                                 P R I O R;
  +RANGE:                                 R A N G E;
  +RANK:                                  R A N K;
  +READONLY:                              R E A D O N L Y;
  +READ_ONLY:                             R E A D '_' O N L Y;
  +RECOMPILE:                             R E C O M P I L E;
  +RELATIVE:                              R E L A T I V E;
  +REMOTE:                                R E M O T E;
  +REPEATABLE:                            R E P E A T A B L E;
  +ROBUST:                                R O B U S T;
  +ROOT:                                  R O O T;
  +ROW:                                   R O W;
  +ROWGUID:                               R O W G U I D;
  +ROWS:                                  R O W S;
  +ROW_NUMBER:                            R O W '_' N U M B E R;
  +SAMPLE:                                S A M P L E;
  +SCHEMABINDING:                         S C H E M A B I N D I N G;
  +SCROLL:                                S C R O L L;
  +SCROLL_LOCKS:                          S C R O L L '_' L O C K S;
  +SELF:                                  S E L F;
  +SERIALIZABLE:                          S E R I A L I Z A B L E;
  +SIMPLE:                                S I M P L E;
  +SNAPSHOT:                              S N A P S H O T;
  +SPATIAL_WINDOW_MAX_CELLS:              S P A T I A L '_' W I N D O W '_' M A X '_' C E L L S;
  +STATIC:                                S T A T I C;
  +STATS_STREAM:                          S T A T S '_' S T R E A M;
  +STDEV:                                 S T D E V;
  +STDEVP:                                S T D E V P;
  +SUM:                                   S U M;
  +THROW:                                 T H R O W;
  +TIES:                                  T I E S;
  +TIME:                                  T I M E;
  +TRY:                                   T R Y;
  +TYPE:                                  T Y P E;
  +TYPE_WARNING:                          T Y P E '_' W A R N I N G;
  +UNBOUNDED:                             U N B O U N D E D;
  +UNCOMMITTED:                           U N C O M M I T T E D;
  +UNKNOWN:                               U N K N O W N;
  +USING:                                 U S I N G;
  +VAR:                                   V A R;
  +VARP:                                  V A R P;
  +VIEW_METADATA:                         V I E W '_' M E T A D A T A;
  +VIEWS:                                 V I E W S;
  +WORK:                                  W O R K;
  +XML:                                   X M L;
  +XMLNAMESPACES:                         X M L N A M E S P A C E S;
  +
  +DOLLAR_ACTION:                         '$' A C T I O N;
  +
  +SPACE:              [ \t\r\n]+    -> skip;
   COMMENT:            '/*' .*? '*/' -> channel(HIDDEN);
   LINE_COMMENT:       '--' ~[\r\n]* -> channel(HIDDEN);
   
  
positive.code:     | SCROLL_LOCKS
      | SELF
      | SERIALIZABLE
      | SNAPSHOT
      | STATIC
      | STATS_STREAM
      | STDEV
  
negative.code: derived_table
      : subquery
      | '(' subquery ')'
      ;
  
  function_call
      : ranking_windowed_function
      | aggregate_windowed_function
      | scalar_function_name '(' expression_list? ')'
      // https://msdn.microsoft.com/en-us/library/ms173784.aspx
      | BINARY_CHECKSUM '(' '*' ')'
      // https://msdn.microsoft.com/en-us/library/hh231076.aspx
      // https://msdn.microsoft.com/en-us/library/ms187928.aspx
      | CAST '(' expression AS data_type ')'
      | CONVERT '(' data_type ',' expression (',' style=expression)? ')'
      // https://msdn.microsoft.com/en-us/library/ms189788.aspx
      | CHECKSUM '(' '*' ')'
      // https://msdn.microsoft.com/en-us/library/ms190349.aspx
      | COALESCE '(' expression_list ')'
      // https://msdn.microsoft.com/en-us/library/ms188751.aspx
      | CURRENT_TIMESTAMP
      // https://msdn.microsoft.com/en-us/library/ms176050.aspx
      | CURRENT_USER
      // https://msdn.microsoft.com/en-us/library/ms186819.aspx
      | DATEADD '(' datepart ',' expression ',' expression ')'
      // https://msdn.microsoft.com/en-us/library/ms189794.aspx
      | DATEDIFF '(' datepart ',' expression ',' expression ')'
      // https://msdn.microsoft.com/en-us/library/ms174395.aspx
      | DATENAME '(' datepart ',' expression ')'
      // https://msdn.microsoft.com/en-us/library/ms174420.aspx
      | DATEPART '(' datepart ',' expression ')'
      // https://msdn.microsoft.com/en-us/library/ms189838.aspx
      | IDENTITY '(' data_type (',' seed=DECIMAL)? (',' increment=DECIMAL)? ')'
      // https://msdn.microsoft.com/en-us/library/bb839514.aspx
      | MIN_ACTIVE_ROWVERSION
      // https://msdn.microsoft.com/en-us/library/ms177562.aspx
      | NULLIF '(' expression ',' expression ')'
      // https://msdn.microsoft.com/en-us/library/ms177587.aspx
      | SESSION_USER
      // https://msdn.microsoft.com/en-us/library/ms179930.aspx
      | SYSTEM_USER
      ;
  
  datepart
      : ID
      ;
  
  as_table_alias
  