# Generated from src/zorg/grammar/zorg_file/ZorgFile.g4 by ANTLR 4.13.1
# encoding: utf-8
from antlr4 import *
from io import StringIO
import sys
if sys.version_info[1] > 5:
	from typing import TextIO
else:
	from typing.io import TextIO

def serializedATN():
    return [
        4,1,35,470,2,0,7,0,2,1,7,1,2,2,7,2,2,3,7,3,2,4,7,4,2,5,7,5,2,6,7,
        6,2,7,7,7,2,8,7,8,2,9,7,9,2,10,7,10,2,11,7,11,2,12,7,12,2,13,7,13,
        2,14,7,14,2,15,7,15,2,16,7,16,2,17,7,17,2,18,7,18,2,19,7,19,2,20,
        7,20,2,21,7,21,2,22,7,22,2,23,7,23,2,24,7,24,2,25,7,25,2,26,7,26,
        2,27,7,27,2,28,7,28,2,29,7,29,2,30,7,30,2,31,7,31,2,32,7,32,2,33,
        7,33,2,34,7,34,2,35,7,35,2,36,7,36,2,37,7,37,2,38,7,38,2,39,7,39,
        2,40,7,40,2,41,7,41,2,42,7,42,2,43,7,43,2,44,7,44,2,45,7,45,2,46,
        7,46,1,0,1,0,4,0,97,8,0,11,0,12,0,98,1,0,5,0,102,8,0,10,0,12,0,105,
        9,0,1,0,5,0,108,8,0,10,0,12,0,111,9,0,1,0,5,0,114,8,0,10,0,12,0,
        117,9,0,3,0,119,8,0,1,0,1,0,1,1,4,1,124,8,1,11,1,12,1,125,1,2,1,
        2,3,2,130,8,2,1,2,1,2,1,3,4,3,135,8,3,11,3,12,3,136,1,3,5,3,140,
        8,3,10,3,12,3,143,9,3,1,4,1,4,1,4,1,4,3,4,149,8,4,1,5,1,5,1,5,1,
        5,1,5,1,6,1,6,1,6,5,6,159,8,6,10,6,12,6,162,9,6,1,7,1,7,1,7,1,8,
        1,8,3,8,169,8,8,1,8,1,8,1,9,1,9,1,9,4,9,176,8,9,11,9,12,9,177,1,
        9,5,9,181,8,9,10,9,12,9,184,9,9,1,10,1,10,1,10,5,10,189,8,10,10,
        10,12,10,192,9,10,1,11,1,11,1,11,1,12,1,12,5,12,199,8,12,10,12,12,
        12,202,9,12,1,13,1,13,1,13,3,13,207,8,13,1,13,1,13,1,13,1,14,1,14,
        1,14,1,14,3,14,216,8,14,1,15,1,15,1,15,3,15,221,8,15,1,16,1,16,1,
        16,1,16,1,16,1,17,1,17,1,18,4,18,231,8,18,11,18,12,18,232,1,19,1,
        19,1,19,3,19,238,8,19,1,19,1,19,5,19,242,8,19,10,19,12,19,245,9,
        19,1,19,1,19,3,19,249,8,19,1,19,1,19,1,19,5,19,254,8,19,10,19,12,
        19,257,9,19,3,19,259,8,19,1,19,3,19,262,8,19,1,20,1,20,1,20,1,20,
        1,20,1,20,1,20,1,20,3,20,272,8,20,1,21,1,21,1,21,1,21,1,21,1,22,
        1,22,4,22,281,8,22,11,22,12,22,282,1,22,1,22,5,22,287,8,22,10,22,
        12,22,290,9,22,1,23,1,23,1,23,1,23,1,23,1,23,3,23,298,8,23,1,24,
        1,24,1,25,1,25,1,26,1,26,1,26,1,26,1,26,3,26,309,8,26,1,27,1,27,
        1,28,1,28,1,29,1,29,1,30,1,30,1,30,1,30,3,30,321,8,30,1,31,1,31,
        1,31,1,32,1,32,1,32,1,33,1,33,1,33,1,34,1,34,1,34,1,35,1,35,1,35,
        1,35,1,35,4,35,340,8,35,11,35,12,35,341,1,35,1,35,1,35,4,35,347,
        8,35,11,35,12,35,348,1,35,1,35,3,35,353,8,35,1,36,1,36,1,36,1,36,
        1,37,1,37,1,37,1,37,1,38,1,38,5,38,365,8,38,10,38,12,38,368,9,38,
        1,38,5,38,371,8,38,10,38,12,38,374,9,38,1,38,3,38,377,8,38,1,38,
        5,38,380,8,38,10,38,12,38,383,9,38,1,39,1,39,5,39,387,8,39,10,39,
        12,39,390,9,39,1,39,5,39,393,8,39,10,39,12,39,396,9,39,1,39,3,39,
        399,8,39,1,39,5,39,402,8,39,10,39,12,39,405,9,39,1,40,1,40,5,40,
        409,8,40,10,40,12,40,412,9,40,1,40,5,40,415,8,40,10,40,12,40,418,
        9,40,1,40,3,40,421,8,40,1,40,5,40,424,8,40,10,40,12,40,427,9,40,
        1,41,1,41,5,41,431,8,41,10,41,12,41,434,9,41,1,41,5,41,437,8,41,
        10,41,12,41,440,9,41,1,42,1,42,1,42,1,42,1,42,1,42,1,42,1,42,1,42,
        1,42,1,42,1,42,1,43,1,43,1,43,1,43,1,44,1,44,1,44,1,44,1,45,1,45,
        1,45,1,45,1,45,1,45,1,46,1,46,1,46,0,0,47,0,2,4,6,8,10,12,14,16,
        18,20,22,24,26,28,30,32,34,36,38,40,42,44,46,48,50,52,54,56,58,60,
        62,64,66,68,70,72,74,76,78,80,82,84,86,88,90,92,0,5,2,0,9,9,32,32,
        4,0,17,17,21,21,24,25,32,35,2,0,18,20,22,22,1,0,26,29,1,1,7,7,496,
        0,94,1,0,0,0,2,123,1,0,0,0,4,127,1,0,0,0,6,134,1,0,0,0,8,148,1,0,
        0,0,10,150,1,0,0,0,12,155,1,0,0,0,14,163,1,0,0,0,16,168,1,0,0,0,
        18,172,1,0,0,0,20,185,1,0,0,0,22,193,1,0,0,0,24,196,1,0,0,0,26,203,
        1,0,0,0,28,215,1,0,0,0,30,217,1,0,0,0,32,222,1,0,0,0,34,227,1,0,
        0,0,36,230,1,0,0,0,38,234,1,0,0,0,40,271,1,0,0,0,42,273,1,0,0,0,
        44,278,1,0,0,0,46,297,1,0,0,0,48,299,1,0,0,0,50,301,1,0,0,0,52,308,
        1,0,0,0,54,310,1,0,0,0,56,312,1,0,0,0,58,314,1,0,0,0,60,320,1,0,
        0,0,62,322,1,0,0,0,64,325,1,0,0,0,66,328,1,0,0,0,68,331,1,0,0,0,
        70,352,1,0,0,0,72,354,1,0,0,0,74,358,1,0,0,0,76,362,1,0,0,0,78,384,
        1,0,0,0,80,406,1,0,0,0,82,428,1,0,0,0,84,441,1,0,0,0,86,453,1,0,
        0,0,88,457,1,0,0,0,90,461,1,0,0,0,92,467,1,0,0,0,94,118,3,2,1,0,
        95,97,5,7,0,0,96,95,1,0,0,0,97,98,1,0,0,0,98,96,1,0,0,0,98,99,1,
        0,0,0,99,103,1,0,0,0,100,102,3,6,3,0,101,100,1,0,0,0,102,105,1,0,
        0,0,103,101,1,0,0,0,103,104,1,0,0,0,104,109,1,0,0,0,105,103,1,0,
        0,0,106,108,3,78,39,0,107,106,1,0,0,0,108,111,1,0,0,0,109,107,1,
        0,0,0,109,110,1,0,0,0,110,115,1,0,0,0,111,109,1,0,0,0,112,114,3,
        76,38,0,113,112,1,0,0,0,114,117,1,0,0,0,115,113,1,0,0,0,115,116,
        1,0,0,0,116,119,1,0,0,0,117,115,1,0,0,0,118,96,1,0,0,0,118,119,1,
        0,0,0,119,120,1,0,0,0,120,121,5,0,0,1,121,1,1,0,0,0,122,124,3,4,
        2,0,123,122,1,0,0,0,124,125,1,0,0,0,125,123,1,0,0,0,125,126,1,0,
        0,0,126,3,1,0,0,0,127,129,5,26,0,0,128,130,3,36,18,0,129,128,1,0,
        0,0,129,130,1,0,0,0,130,131,1,0,0,0,131,132,5,7,0,0,132,5,1,0,0,
        0,133,135,3,8,4,0,134,133,1,0,0,0,135,136,1,0,0,0,136,134,1,0,0,
        0,136,137,1,0,0,0,137,141,1,0,0,0,138,140,5,7,0,0,139,138,1,0,0,
        0,140,143,1,0,0,0,141,139,1,0,0,0,141,142,1,0,0,0,142,7,1,0,0,0,
        143,141,1,0,0,0,144,149,3,24,12,0,145,149,3,12,6,0,146,149,3,10,
        5,0,147,149,3,4,2,0,148,144,1,0,0,0,148,145,1,0,0,0,148,146,1,0,
        0,0,148,147,1,0,0,0,149,9,1,0,0,0,150,151,3,74,37,0,151,152,5,22,
        0,0,152,153,3,36,18,0,153,154,5,7,0,0,154,11,1,0,0,0,155,156,5,18,
        0,0,156,160,3,14,7,0,157,159,3,20,10,0,158,157,1,0,0,0,159,162,1,
        0,0,0,160,158,1,0,0,0,160,161,1,0,0,0,161,13,1,0,0,0,162,160,1,0,
        0,0,163,164,3,16,8,0,164,165,5,7,0,0,165,15,1,0,0,0,166,167,5,23,
        0,0,167,169,3,34,17,0,168,166,1,0,0,0,168,169,1,0,0,0,169,170,1,
        0,0,0,170,171,3,18,9,0,171,17,1,0,0,0,172,182,3,36,18,0,173,175,
        5,7,0,0,174,176,5,23,0,0,175,174,1,0,0,0,176,177,1,0,0,0,177,175,
        1,0,0,0,177,178,1,0,0,0,178,179,1,0,0,0,179,181,3,36,18,0,180,173,
        1,0,0,0,181,184,1,0,0,0,182,180,1,0,0,0,182,183,1,0,0,0,183,19,1,
        0,0,0,184,182,1,0,0,0,185,186,5,15,0,0,186,190,3,14,7,0,187,189,
        3,22,11,0,188,187,1,0,0,0,189,192,1,0,0,0,190,188,1,0,0,0,190,191,
        1,0,0,0,191,21,1,0,0,0,192,190,1,0,0,0,193,194,5,16,0,0,194,195,
        3,14,7,0,195,23,1,0,0,0,196,200,3,26,13,0,197,199,3,20,10,0,198,
        197,1,0,0,0,199,202,1,0,0,0,200,198,1,0,0,0,200,201,1,0,0,0,201,
        25,1,0,0,0,202,200,1,0,0,0,203,206,3,28,14,0,204,205,5,23,0,0,205,
        207,3,32,16,0,206,204,1,0,0,0,206,207,1,0,0,0,207,208,1,0,0,0,208,
        209,3,16,8,0,209,210,5,7,0,0,210,27,1,0,0,0,211,216,5,8,0,0,212,
        216,3,30,15,0,213,216,5,34,0,0,214,216,5,35,0,0,215,211,1,0,0,0,
        215,212,1,0,0,0,215,213,1,0,0,0,215,214,1,0,0,0,216,29,1,0,0,0,217,
        220,7,0,0,0,218,219,5,22,0,0,219,221,3,50,25,0,220,218,1,0,0,0,220,
        221,1,0,0,0,221,31,1,0,0,0,222,223,5,1,0,0,223,224,5,26,0,0,224,
        225,5,10,0,0,225,226,5,2,0,0,226,33,1,0,0,0,227,228,5,13,0,0,228,
        35,1,0,0,0,229,231,3,38,19,0,230,229,1,0,0,0,231,232,1,0,0,0,232,
        230,1,0,0,0,232,233,1,0,0,0,233,37,1,0,0,0,234,237,5,23,0,0,235,
        236,5,30,0,0,236,238,3,54,27,0,237,235,1,0,0,0,237,238,1,0,0,0,238,
        243,1,0,0,0,239,242,3,54,27,0,240,242,5,31,0,0,241,239,1,0,0,0,241,
        240,1,0,0,0,242,245,1,0,0,0,243,241,1,0,0,0,243,244,1,0,0,0,244,
        248,1,0,0,0,245,243,1,0,0,0,246,249,3,40,20,0,247,249,3,70,35,0,
        248,246,1,0,0,0,248,247,1,0,0,0,248,249,1,0,0,0,249,258,1,0,0,0,
        250,255,3,52,26,0,251,254,3,52,26,0,252,254,3,46,23,0,253,251,1,
        0,0,0,253,252,1,0,0,0,254,257,1,0,0,0,255,253,1,0,0,0,255,256,1,
        0,0,0,256,259,1,0,0,0,257,255,1,0,0,0,258,250,1,0,0,0,258,259,1,
        0,0,0,259,261,1,0,0,0,260,262,3,74,37,0,261,260,1,0,0,0,261,262,
        1,0,0,0,262,39,1,0,0,0,263,272,3,58,29,0,264,272,3,60,30,0,265,272,
        3,72,36,0,266,272,3,42,21,0,267,272,3,44,22,0,268,272,3,74,37,0,
        269,272,3,34,17,0,270,272,3,32,16,0,271,263,1,0,0,0,271,264,1,0,
        0,0,271,265,1,0,0,0,271,266,1,0,0,0,271,267,1,0,0,0,271,268,1,0,
        0,0,271,269,1,0,0,0,271,270,1,0,0,0,272,41,1,0,0,0,273,274,5,10,
        0,0,274,275,5,22,0,0,275,276,5,22,0,0,276,277,3,44,22,0,277,43,1,
        0,0,0,278,288,3,46,23,0,279,281,3,56,28,0,280,279,1,0,0,0,281,282,
        1,0,0,0,282,280,1,0,0,0,282,283,1,0,0,0,283,284,1,0,0,0,284,285,
        3,46,23,0,285,287,1,0,0,0,286,280,1,0,0,0,287,290,1,0,0,0,288,286,
        1,0,0,0,288,289,1,0,0,0,289,45,1,0,0,0,290,288,1,0,0,0,291,298,5,
        10,0,0,292,298,5,14,0,0,293,298,3,48,24,0,294,298,3,50,25,0,295,
        298,5,8,0,0,296,298,5,9,0,0,297,291,1,0,0,0,297,292,1,0,0,0,297,
        293,1,0,0,0,297,294,1,0,0,0,297,295,1,0,0,0,297,296,1,0,0,0,298,
        47,1,0,0,0,299,300,5,11,0,0,300,49,1,0,0,0,301,302,5,12,0,0,302,
        51,1,0,0,0,303,309,5,30,0,0,304,309,5,31,0,0,305,309,3,54,27,0,306,
        309,3,58,29,0,307,309,3,56,28,0,308,303,1,0,0,0,308,304,1,0,0,0,
        308,305,1,0,0,0,308,306,1,0,0,0,308,307,1,0,0,0,309,53,1,0,0,0,310,
        311,7,1,0,0,311,55,1,0,0,0,312,313,7,2,0,0,313,57,1,0,0,0,314,315,
        7,3,0,0,315,59,1,0,0,0,316,321,3,62,31,0,317,321,3,64,32,0,318,321,
        3,66,33,0,319,321,3,68,34,0,320,316,1,0,0,0,320,317,1,0,0,0,320,
        318,1,0,0,0,320,319,1,0,0,0,321,61,1,0,0,0,322,323,5,26,0,0,323,
        324,5,10,0,0,324,63,1,0,0,0,325,326,5,27,0,0,326,327,5,10,0,0,327,
        65,1,0,0,0,328,329,5,29,0,0,329,330,5,10,0,0,330,67,1,0,0,0,331,
        332,5,28,0,0,332,333,5,10,0,0,333,69,1,0,0,0,334,339,5,30,0,0,335,
        340,3,40,20,0,336,340,3,32,16,0,337,340,5,3,0,0,338,340,5,4,0,0,
        339,335,1,0,0,0,339,336,1,0,0,0,339,337,1,0,0,0,339,338,1,0,0,0,
        340,341,1,0,0,0,341,339,1,0,0,0,341,342,1,0,0,0,342,343,1,0,0,0,
        343,353,5,30,0,0,344,346,5,31,0,0,345,347,3,40,20,0,346,345,1,0,
        0,0,347,348,1,0,0,0,348,346,1,0,0,0,348,349,1,0,0,0,349,350,1,0,
        0,0,350,351,5,31,0,0,351,353,1,0,0,0,352,334,1,0,0,0,352,344,1,0,
        0,0,353,71,1,0,0,0,354,355,5,3,0,0,355,356,3,44,22,0,356,357,5,4,
        0,0,357,73,1,0,0,0,358,359,5,1,0,0,359,360,3,44,22,0,360,361,5,2,
        0,0,361,75,1,0,0,0,362,366,3,84,42,0,363,365,5,7,0,0,364,363,1,0,
        0,0,365,368,1,0,0,0,366,364,1,0,0,0,366,367,1,0,0,0,367,372,1,0,
        0,0,368,366,1,0,0,0,369,371,3,6,3,0,370,369,1,0,0,0,371,374,1,0,
        0,0,372,370,1,0,0,0,372,373,1,0,0,0,373,381,1,0,0,0,374,372,1,0,
        0,0,375,377,5,7,0,0,376,375,1,0,0,0,376,377,1,0,0,0,377,378,1,0,
        0,0,378,380,3,78,39,0,379,376,1,0,0,0,380,383,1,0,0,0,381,379,1,
        0,0,0,381,382,1,0,0,0,382,77,1,0,0,0,383,381,1,0,0,0,384,388,3,86,
        43,0,385,387,5,7,0,0,386,385,1,0,0,0,387,390,1,0,0,0,388,386,1,0,
        0,0,388,389,1,0,0,0,389,394,1,0,0,0,390,388,1,0,0,0,391,393,3,6,
        3,0,392,391,1,0,0,0,393,396,1,0,0,0,394,392,1,0,0,0,394,395,1,0,
        0,0,395,403,1,0,0,0,396,394,1,0,0,0,397,399,5,7,0,0,398,397,1,0,
        0,0,398,399,1,0,0,0,399,400,1,0,0,0,400,402,3,80,40,0,401,398,1,
        0,0,0,402,405,1,0,0,0,403,401,1,0,0,0,403,404,1,0,0,0,404,79,1,0,
        0,0,405,403,1,0,0,0,406,410,3,88,44,0,407,409,5,7,0,0,408,407,1,
        0,0,0,409,412,1,0,0,0,410,408,1,0,0,0,410,411,1,0,0,0,411,416,1,
        0,0,0,412,410,1,0,0,0,413,415,3,6,3,0,414,413,1,0,0,0,415,418,1,
        0,0,0,416,414,1,0,0,0,416,417,1,0,0,0,417,425,1,0,0,0,418,416,1,
        0,0,0,419,421,5,7,0,0,420,419,1,0,0,0,420,421,1,0,0,0,421,422,1,
        0,0,0,422,424,3,82,41,0,423,420,1,0,0,0,424,427,1,0,0,0,425,423,
        1,0,0,0,425,426,1,0,0,0,426,81,1,0,0,0,427,425,1,0,0,0,428,432,3,
        90,45,0,429,431,5,7,0,0,430,429,1,0,0,0,431,434,1,0,0,0,432,430,
        1,0,0,0,432,433,1,0,0,0,433,438,1,0,0,0,434,432,1,0,0,0,435,437,
        3,6,3,0,436,435,1,0,0,0,437,440,1,0,0,0,438,436,1,0,0,0,438,439,
        1,0,0,0,439,83,1,0,0,0,440,438,1,0,0,0,441,442,5,26,0,0,442,443,
        5,26,0,0,443,444,5,26,0,0,444,445,5,26,0,0,445,446,5,26,0,0,446,
        447,5,26,0,0,447,448,5,26,0,0,448,449,5,26,0,0,449,450,5,26,0,0,
        450,451,3,36,18,0,451,452,3,92,46,0,452,85,1,0,0,0,453,454,5,5,0,
        0,454,455,3,36,18,0,455,456,3,92,46,0,456,87,1,0,0,0,457,458,5,6,
        0,0,458,459,3,36,18,0,459,460,3,92,46,0,460,89,1,0,0,0,461,462,5,
        18,0,0,462,463,5,18,0,0,463,464,5,18,0,0,464,465,3,36,18,0,465,466,
        3,92,46,0,466,91,1,0,0,0,467,468,7,4,0,0,468,93,1,0,0,0,52,98,103,
        109,115,118,125,129,136,141,148,160,168,177,182,190,200,206,215,
        220,232,237,241,243,248,253,255,258,261,271,282,288,297,308,320,
        339,341,348,352,366,372,376,381,388,394,398,403,410,416,420,425,
        432,438
    ]

class ZorgFileParser ( Parser ):

    grammarFileName = "ZorgFile.g4"

    atn = ATNDeserializer().deserialize(serializedATN())

    decisionsToDFA = [ DFA(ds, i) for i, ds in enumerate(atn.decisionToState) ]

    sharedContextCache = PredictionContextCache()

    literalNames = [ "<INVALID>", "'['", "']'", "'[['", "']]'", "'======='", 
                     "'*****'", "<INVALID>", "'o'", "'x'", "<INVALID>", 
                     "<INVALID>", "<INVALID>", "<INVALID>", "<INVALID>", 
                     "'  -'", "'    -'", "<INVALID>", "'-'", "'.'", "'/'", 
                     "'_'", "':'", "' '", "'('", "')'", "'#'", "'@'", "'+'", 
                     "'%'", "'''", "'\"'", "'~'", "'*'", "'<'", "'>'" ]

    symbolicNames = [ "<INVALID>", "<INVALID>", "<INVALID>", "<INVALID>", 
                      "<INVALID>", "<INVALID>", "<INVALID>", "NL", "LOWER_O", 
                      "LOWER_X", "ID", "DATE", "TIME", "ZID", "NUM_ID", 
                      "TWO_SPACE_DASH", "FOUR_SPACE_DASH", "SYMBOL", "DASH", 
                      "DOT", "FSLASH", "UNDERSCORE", "COLON", "SPACE", "LPAREN", 
                      "RPAREN", "HASH", "AT_SIGN", "PLUS", "PERCENT", "SQUOTE", 
                      "DQUOTE", "TILDE", "STAR", "LANGLE", "RANGLE" ]

    RULE_prog = 0
    RULE_head = 1
    RULE_comment = 2
    RULE_block = 3
    RULE_item = 4
    RULE_footnote = 5
    RULE_note = 6
    RULE_base_note = 7
    RULE_id_note_body = 8
    RULE_note_body = 9
    RULE_subnote = 10
    RULE_subsubnote = 11
    RULE_todo = 12
    RULE_base_todo = 13
    RULE_todo_prefix = 14
    RULE_x_or_tilde = 15
    RULE_priority = 16
    RULE_zid = 17
    RULE_space_atoms = 18
    RULE_space_atom = 19
    RULE_atom = 20
    RULE_property = 21
    RULE_id_group = 22
    RULE_id = 23
    RULE_date = 24
    RULE_time = 25
    RULE_any_symbol = 26
    RULE_non_tag_symbol = 27
    RULE_id_symbol = 28
    RULE_tag_symbol = 29
    RULE_tag = 30
    RULE_area = 31
    RULE_context = 32
    RULE_person = 33
    RULE_project = 34
    RULE_quoted = 35
    RULE_link = 36
    RULE_ref = 37
    RULE_h1_section = 38
    RULE_h2_section = 39
    RULE_h3_section = 40
    RULE_h4_section = 41
    RULE_h1_header = 42
    RULE_h2_header = 43
    RULE_h3_header = 44
    RULE_h4_header = 45
    RULE_eol = 46

    ruleNames =  [ "prog", "head", "comment", "block", "item", "footnote", 
                   "note", "base_note", "id_note_body", "note_body", "subnote", 
                   "subsubnote", "todo", "base_todo", "todo_prefix", "x_or_tilde", 
                   "priority", "zid", "space_atoms", "space_atom", "atom", 
                   "property", "id_group", "id", "date", "time", "any_symbol", 
                   "non_tag_symbol", "id_symbol", "tag_symbol", "tag", "area", 
                   "context", "person", "project", "quoted", "link", "ref", 
                   "h1_section", "h2_section", "h3_section", "h4_section", 
                   "h1_header", "h2_header", "h3_header", "h4_header", "eol" ]

    EOF = Token.EOF
    T__0=1
    T__1=2
    T__2=3
    T__3=4
    T__4=5
    T__5=6
    NL=7
    LOWER_O=8
    LOWER_X=9
    ID=10
    DATE=11
    TIME=12
    ZID=13
    NUM_ID=14
    TWO_SPACE_DASH=15
    FOUR_SPACE_DASH=16
    SYMBOL=17
    DASH=18
    DOT=19
    FSLASH=20
    UNDERSCORE=21
    COLON=22
    SPACE=23
    LPAREN=24
    RPAREN=25
    HASH=26
    AT_SIGN=27
    PLUS=28
    PERCENT=29
    SQUOTE=30
    DQUOTE=31
    TILDE=32
    STAR=33
    LANGLE=34
    RANGLE=35

    def __init__(self, input:TokenStream, output:TextIO = sys.stdout):
        super().__init__(input, output)
        self.checkVersion("4.13.1")
        self._interp = ParserATNSimulator(self, self.atn, self.decisionsToDFA, self.sharedContextCache)
        self._predicates = None




    class ProgContext(ParserRuleContext):
        __slots__ = 'parser'

        def __init__(self, parser, parent:ParserRuleContext=None, invokingState:int=-1):
            super().__init__(parent, invokingState)
            self.parser = parser

        def head(self):
            return self.getTypedRuleContext(ZorgFileParser.HeadContext,0)


        def EOF(self):
            return self.getToken(ZorgFileParser.EOF, 0)

        def NL(self, i:int=None):
            if i is None:
                return self.getTokens(ZorgFileParser.NL)
            else:
                return self.getToken(ZorgFileParser.NL, i)

        def block(self, i:int=None):
            if i is None:
                return self.getTypedRuleContexts(ZorgFileParser.BlockContext)
            else:
                return self.getTypedRuleContext(ZorgFileParser.BlockContext,i)


        def h2_section(self, i:int=None):
            if i is None:
                return self.getTypedRuleContexts(ZorgFileParser.H2_sectionContext)
            else:
                return self.getTypedRuleContext(ZorgFileParser.H2_sectionContext,i)


        def h1_section(self, i:int=None):
            if i is None:
                return self.getTypedRuleContexts(ZorgFileParser.H1_sectionContext)
            else:
                return self.getTypedRuleContext(ZorgFileParser.H1_sectionContext,i)


        def getRuleIndex(self):
            return ZorgFileParser.RULE_prog

        def enterRule(self, listener:ParseTreeListener):
            if hasattr( listener, "enterProg" ):
                listener.enterProg(self)

        def exitRule(self, listener:ParseTreeListener):
            if hasattr( listener, "exitProg" ):
                listener.exitProg(self)




    def prog(self):

        localctx = ZorgFileParser.ProgContext(self, self._ctx, self.state)
        self.enterRule(localctx, 0, self.RULE_prog)
        self._la = 0 # Token type
        try:
            self.enterOuterAlt(localctx, 1)
            self.state = 94
            self.head()
            self.state = 118
            self._errHandler.sync(self)
            _la = self._input.LA(1)
            if _la==7:
                self.state = 96 
                self._errHandler.sync(self)
                _la = self._input.LA(1)
                while True:
                    self.state = 95
                    self.match(ZorgFileParser.NL)
                    self.state = 98 
                    self._errHandler.sync(self)
                    _la = self._input.LA(1)
                    if not (_la==7):
                        break

                self.state = 103
                self._errHandler.sync(self)
                _alt = self._interp.adaptivePredict(self._input,1,self._ctx)
                while _alt!=2 and _alt!=ATN.INVALID_ALT_NUMBER:
                    if _alt==1:
                        self.state = 100
                        self.block() 
                    self.state = 105
                    self._errHandler.sync(self)
                    _alt = self._interp.adaptivePredict(self._input,1,self._ctx)

                self.state = 109
                self._errHandler.sync(self)
                _la = self._input.LA(1)
                while _la==5:
                    self.state = 106
                    self.h2_section()
                    self.state = 111
                    self._errHandler.sync(self)
                    _la = self._input.LA(1)

                self.state = 115
                self._errHandler.sync(self)
                _la = self._input.LA(1)
                while _la==26:
                    self.state = 112
                    self.h1_section()
                    self.state = 117
                    self._errHandler.sync(self)
                    _la = self._input.LA(1)



            self.state = 120
            self.match(ZorgFileParser.EOF)
        except RecognitionException as re:
            localctx.exception = re
            self._errHandler.reportError(self, re)
            self._errHandler.recover(self, re)
        finally:
            self.exitRule()
        return localctx


    class HeadContext(ParserRuleContext):
        __slots__ = 'parser'

        def __init__(self, parser, parent:ParserRuleContext=None, invokingState:int=-1):
            super().__init__(parent, invokingState)
            self.parser = parser

        def comment(self, i:int=None):
            if i is None:
                return self.getTypedRuleContexts(ZorgFileParser.CommentContext)
            else:
                return self.getTypedRuleContext(ZorgFileParser.CommentContext,i)


        def getRuleIndex(self):
            return ZorgFileParser.RULE_head

        def enterRule(self, listener:ParseTreeListener):
            if hasattr( listener, "enterHead" ):
                listener.enterHead(self)

        def exitRule(self, listener:ParseTreeListener):
            if hasattr( listener, "exitHead" ):
                listener.exitHead(self)




    def head(self):

        localctx = ZorgFileParser.HeadContext(self, self._ctx, self.state)
        self.enterRule(localctx, 2, self.RULE_head)
        self._la = 0 # Token type
        try:
            self.enterOuterAlt(localctx, 1)
            self.state = 123 
            self._errHandler.sync(self)
            _la = self._input.LA(1)
            while True:
                self.state = 122
                self.comment()
                self.state = 125 
                self._errHandler.sync(self)
                _la = self._input.LA(1)
                if not (_la==26):
                    break

        except RecognitionException as re:
            localctx.exception = re
            self._errHandler.reportError(self, re)
            self._errHandler.recover(self, re)
        finally:
            self.exitRule()
        return localctx


    class CommentContext(ParserRuleContext):
        __slots__ = 'parser'

        def __init__(self, parser, parent:ParserRuleContext=None, invokingState:int=-1):
            super().__init__(parent, invokingState)
            self.parser = parser

        def HASH(self):
            return self.getToken(ZorgFileParser.HASH, 0)

        def NL(self):
            return self.getToken(ZorgFileParser.NL, 0)

        def space_atoms(self):
            return self.getTypedRuleContext(ZorgFileParser.Space_atomsContext,0)


        def getRuleIndex(self):
            return ZorgFileParser.RULE_comment

        def enterRule(self, listener:ParseTreeListener):
            if hasattr( listener, "enterComment" ):
                listener.enterComment(self)

        def exitRule(self, listener:ParseTreeListener):
            if hasattr( listener, "exitComment" ):
                listener.exitComment(self)




    def comment(self):

        localctx = ZorgFileParser.CommentContext(self, self._ctx, self.state)
        self.enterRule(localctx, 4, self.RULE_comment)
        self._la = 0 # Token type
        try:
            self.enterOuterAlt(localctx, 1)
            self.state = 127
            self.match(ZorgFileParser.HASH)
            self.state = 129
            self._errHandler.sync(self)
            _la = self._input.LA(1)
            if _la==23:
                self.state = 128
                self.space_atoms()


            self.state = 131
            self.match(ZorgFileParser.NL)
        except RecognitionException as re:
            localctx.exception = re
            self._errHandler.reportError(self, re)
            self._errHandler.recover(self, re)
        finally:
            self.exitRule()
        return localctx


    class BlockContext(ParserRuleContext):
        __slots__ = 'parser'

        def __init__(self, parser, parent:ParserRuleContext=None, invokingState:int=-1):
            super().__init__(parent, invokingState)
            self.parser = parser

        def item(self, i:int=None):
            if i is None:
                return self.getTypedRuleContexts(ZorgFileParser.ItemContext)
            else:
                return self.getTypedRuleContext(ZorgFileParser.ItemContext,i)


        def NL(self, i:int=None):
            if i is None:
                return self.getTokens(ZorgFileParser.NL)
            else:
                return self.getToken(ZorgFileParser.NL, i)

        def getRuleIndex(self):
            return ZorgFileParser.RULE_block

        def enterRule(self, listener:ParseTreeListener):
            if hasattr( listener, "enterBlock" ):
                listener.enterBlock(self)

        def exitRule(self, listener:ParseTreeListener):
            if hasattr( listener, "exitBlock" ):
                listener.exitBlock(self)




    def block(self):

        localctx = ZorgFileParser.BlockContext(self, self._ctx, self.state)
        self.enterRule(localctx, 6, self.RULE_block)
        try:
            self.enterOuterAlt(localctx, 1)
            self.state = 134 
            self._errHandler.sync(self)
            _alt = 1
            while _alt!=2 and _alt!=ATN.INVALID_ALT_NUMBER:
                if _alt == 1:
                    self.state = 133
                    self.item()

                else:
                    raise NoViableAltException(self)
                self.state = 136 
                self._errHandler.sync(self)
                _alt = self._interp.adaptivePredict(self._input,7,self._ctx)

            self.state = 141
            self._errHandler.sync(self)
            _alt = self._interp.adaptivePredict(self._input,8,self._ctx)
            while _alt!=2 and _alt!=ATN.INVALID_ALT_NUMBER:
                if _alt==1:
                    self.state = 138
                    self.match(ZorgFileParser.NL) 
                self.state = 143
                self._errHandler.sync(self)
                _alt = self._interp.adaptivePredict(self._input,8,self._ctx)

        except RecognitionException as re:
            localctx.exception = re
            self._errHandler.reportError(self, re)
            self._errHandler.recover(self, re)
        finally:
            self.exitRule()
        return localctx


    class ItemContext(ParserRuleContext):
        __slots__ = 'parser'

        def __init__(self, parser, parent:ParserRuleContext=None, invokingState:int=-1):
            super().__init__(parent, invokingState)
            self.parser = parser

        def todo(self):
            return self.getTypedRuleContext(ZorgFileParser.TodoContext,0)


        def note(self):
            return self.getTypedRuleContext(ZorgFileParser.NoteContext,0)


        def footnote(self):
            return self.getTypedRuleContext(ZorgFileParser.FootnoteContext,0)


        def comment(self):
            return self.getTypedRuleContext(ZorgFileParser.CommentContext,0)


        def getRuleIndex(self):
            return ZorgFileParser.RULE_item

        def enterRule(self, listener:ParseTreeListener):
            if hasattr( listener, "enterItem" ):
                listener.enterItem(self)

        def exitRule(self, listener:ParseTreeListener):
            if hasattr( listener, "exitItem" ):
                listener.exitItem(self)




    def item(self):

        localctx = ZorgFileParser.ItemContext(self, self._ctx, self.state)
        self.enterRule(localctx, 8, self.RULE_item)
        try:
            self.state = 148
            self._errHandler.sync(self)
            token = self._input.LA(1)
            if token in [8, 9, 32, 34, 35]:
                self.enterOuterAlt(localctx, 1)
                self.state = 144
                self.todo()
                pass
            elif token in [18]:
                self.enterOuterAlt(localctx, 2)
                self.state = 145
                self.note()
                pass
            elif token in [1]:
                self.enterOuterAlt(localctx, 3)
                self.state = 146
                self.footnote()
                pass
            elif token in [26]:
                self.enterOuterAlt(localctx, 4)
                self.state = 147
                self.comment()
                pass
            else:
                raise NoViableAltException(self)

        except RecognitionException as re:
            localctx.exception = re
            self._errHandler.reportError(self, re)
            self._errHandler.recover(self, re)
        finally:
            self.exitRule()
        return localctx


    class FootnoteContext(ParserRuleContext):
        __slots__ = 'parser'

        def __init__(self, parser, parent:ParserRuleContext=None, invokingState:int=-1):
            super().__init__(parent, invokingState)
            self.parser = parser

        def ref(self):
            return self.getTypedRuleContext(ZorgFileParser.RefContext,0)


        def COLON(self):
            return self.getToken(ZorgFileParser.COLON, 0)

        def space_atoms(self):
            return self.getTypedRuleContext(ZorgFileParser.Space_atomsContext,0)


        def NL(self):
            return self.getToken(ZorgFileParser.NL, 0)

        def getRuleIndex(self):
            return ZorgFileParser.RULE_footnote

        def enterRule(self, listener:ParseTreeListener):
            if hasattr( listener, "enterFootnote" ):
                listener.enterFootnote(self)

        def exitRule(self, listener:ParseTreeListener):
            if hasattr( listener, "exitFootnote" ):
                listener.exitFootnote(self)




    def footnote(self):

        localctx = ZorgFileParser.FootnoteContext(self, self._ctx, self.state)
        self.enterRule(localctx, 10, self.RULE_footnote)
        try:
            self.enterOuterAlt(localctx, 1)
            self.state = 150
            self.ref()
            self.state = 151
            self.match(ZorgFileParser.COLON)
            self.state = 152
            self.space_atoms()
            self.state = 153
            self.match(ZorgFileParser.NL)
        except RecognitionException as re:
            localctx.exception = re
            self._errHandler.reportError(self, re)
            self._errHandler.recover(self, re)
        finally:
            self.exitRule()
        return localctx


    class NoteContext(ParserRuleContext):
        __slots__ = 'parser'

        def __init__(self, parser, parent:ParserRuleContext=None, invokingState:int=-1):
            super().__init__(parent, invokingState)
            self.parser = parser

        def DASH(self):
            return self.getToken(ZorgFileParser.DASH, 0)

        def base_note(self):
            return self.getTypedRuleContext(ZorgFileParser.Base_noteContext,0)


        def subnote(self, i:int=None):
            if i is None:
                return self.getTypedRuleContexts(ZorgFileParser.SubnoteContext)
            else:
                return self.getTypedRuleContext(ZorgFileParser.SubnoteContext,i)


        def getRuleIndex(self):
            return ZorgFileParser.RULE_note

        def enterRule(self, listener:ParseTreeListener):
            if hasattr( listener, "enterNote" ):
                listener.enterNote(self)

        def exitRule(self, listener:ParseTreeListener):
            if hasattr( listener, "exitNote" ):
                listener.exitNote(self)




    def note(self):

        localctx = ZorgFileParser.NoteContext(self, self._ctx, self.state)
        self.enterRule(localctx, 12, self.RULE_note)
        self._la = 0 # Token type
        try:
            self.enterOuterAlt(localctx, 1)
            self.state = 155
            self.match(ZorgFileParser.DASH)
            self.state = 156
            self.base_note()
            self.state = 160
            self._errHandler.sync(self)
            _la = self._input.LA(1)
            while _la==15:
                self.state = 157
                self.subnote()
                self.state = 162
                self._errHandler.sync(self)
                _la = self._input.LA(1)

        except RecognitionException as re:
            localctx.exception = re
            self._errHandler.reportError(self, re)
            self._errHandler.recover(self, re)
        finally:
            self.exitRule()
        return localctx


    class Base_noteContext(ParserRuleContext):
        __slots__ = 'parser'

        def __init__(self, parser, parent:ParserRuleContext=None, invokingState:int=-1):
            super().__init__(parent, invokingState)
            self.parser = parser

        def id_note_body(self):
            return self.getTypedRuleContext(ZorgFileParser.Id_note_bodyContext,0)


        def NL(self):
            return self.getToken(ZorgFileParser.NL, 0)

        def getRuleIndex(self):
            return ZorgFileParser.RULE_base_note

        def enterRule(self, listener:ParseTreeListener):
            if hasattr( listener, "enterBase_note" ):
                listener.enterBase_note(self)

        def exitRule(self, listener:ParseTreeListener):
            if hasattr( listener, "exitBase_note" ):
                listener.exitBase_note(self)




    def base_note(self):

        localctx = ZorgFileParser.Base_noteContext(self, self._ctx, self.state)
        self.enterRule(localctx, 14, self.RULE_base_note)
        try:
            self.enterOuterAlt(localctx, 1)
            self.state = 163
            self.id_note_body()
            self.state = 164
            self.match(ZorgFileParser.NL)
        except RecognitionException as re:
            localctx.exception = re
            self._errHandler.reportError(self, re)
            self._errHandler.recover(self, re)
        finally:
            self.exitRule()
        return localctx


    class Id_note_bodyContext(ParserRuleContext):
        __slots__ = 'parser'

        def __init__(self, parser, parent:ParserRuleContext=None, invokingState:int=-1):
            super().__init__(parent, invokingState)
            self.parser = parser

        def note_body(self):
            return self.getTypedRuleContext(ZorgFileParser.Note_bodyContext,0)


        def SPACE(self):
            return self.getToken(ZorgFileParser.SPACE, 0)

        def zid(self):
            return self.getTypedRuleContext(ZorgFileParser.ZidContext,0)


        def getRuleIndex(self):
            return ZorgFileParser.RULE_id_note_body

        def enterRule(self, listener:ParseTreeListener):
            if hasattr( listener, "enterId_note_body" ):
                listener.enterId_note_body(self)

        def exitRule(self, listener:ParseTreeListener):
            if hasattr( listener, "exitId_note_body" ):
                listener.exitId_note_body(self)




    def id_note_body(self):

        localctx = ZorgFileParser.Id_note_bodyContext(self, self._ctx, self.state)
        self.enterRule(localctx, 16, self.RULE_id_note_body)
        try:
            self.enterOuterAlt(localctx, 1)
            self.state = 168
            self._errHandler.sync(self)
            la_ = self._interp.adaptivePredict(self._input,11,self._ctx)
            if la_ == 1:
                self.state = 166
                self.match(ZorgFileParser.SPACE)
                self.state = 167
                self.zid()


            self.state = 170
            self.note_body()
        except RecognitionException as re:
            localctx.exception = re
            self._errHandler.reportError(self, re)
            self._errHandler.recover(self, re)
        finally:
            self.exitRule()
        return localctx


    class Note_bodyContext(ParserRuleContext):
        __slots__ = 'parser'

        def __init__(self, parser, parent:ParserRuleContext=None, invokingState:int=-1):
            super().__init__(parent, invokingState)
            self.parser = parser

        def space_atoms(self, i:int=None):
            if i is None:
                return self.getTypedRuleContexts(ZorgFileParser.Space_atomsContext)
            else:
                return self.getTypedRuleContext(ZorgFileParser.Space_atomsContext,i)


        def NL(self, i:int=None):
            if i is None:
                return self.getTokens(ZorgFileParser.NL)
            else:
                return self.getToken(ZorgFileParser.NL, i)

        def SPACE(self, i:int=None):
            if i is None:
                return self.getTokens(ZorgFileParser.SPACE)
            else:
                return self.getToken(ZorgFileParser.SPACE, i)

        def getRuleIndex(self):
            return ZorgFileParser.RULE_note_body

        def enterRule(self, listener:ParseTreeListener):
            if hasattr( listener, "enterNote_body" ):
                listener.enterNote_body(self)

        def exitRule(self, listener:ParseTreeListener):
            if hasattr( listener, "exitNote_body" ):
                listener.exitNote_body(self)




    def note_body(self):

        localctx = ZorgFileParser.Note_bodyContext(self, self._ctx, self.state)
        self.enterRule(localctx, 18, self.RULE_note_body)
        try:
            self.enterOuterAlt(localctx, 1)
            self.state = 172
            self.space_atoms()
            self.state = 182
            self._errHandler.sync(self)
            _alt = self._interp.adaptivePredict(self._input,13,self._ctx)
            while _alt!=2 and _alt!=ATN.INVALID_ALT_NUMBER:
                if _alt==1:
                    self.state = 173
                    self.match(ZorgFileParser.NL)
                    self.state = 175 
                    self._errHandler.sync(self)
                    _alt = 1
                    while _alt!=2 and _alt!=ATN.INVALID_ALT_NUMBER:
                        if _alt == 1:
                            self.state = 174
                            self.match(ZorgFileParser.SPACE)

                        else:
                            raise NoViableAltException(self)
                        self.state = 177 
                        self._errHandler.sync(self)
                        _alt = self._interp.adaptivePredict(self._input,12,self._ctx)

                    self.state = 179
                    self.space_atoms() 
                self.state = 184
                self._errHandler.sync(self)
                _alt = self._interp.adaptivePredict(self._input,13,self._ctx)

        except RecognitionException as re:
            localctx.exception = re
            self._errHandler.reportError(self, re)
            self._errHandler.recover(self, re)
        finally:
            self.exitRule()
        return localctx


    class SubnoteContext(ParserRuleContext):
        __slots__ = 'parser'

        def __init__(self, parser, parent:ParserRuleContext=None, invokingState:int=-1):
            super().__init__(parent, invokingState)
            self.parser = parser

        def TWO_SPACE_DASH(self):
            return self.getToken(ZorgFileParser.TWO_SPACE_DASH, 0)

        def base_note(self):
            return self.getTypedRuleContext(ZorgFileParser.Base_noteContext,0)


        def subsubnote(self, i:int=None):
            if i is None:
                return self.getTypedRuleContexts(ZorgFileParser.SubsubnoteContext)
            else:
                return self.getTypedRuleContext(ZorgFileParser.SubsubnoteContext,i)


        def getRuleIndex(self):
            return ZorgFileParser.RULE_subnote

        def enterRule(self, listener:ParseTreeListener):
            if hasattr( listener, "enterSubnote" ):
                listener.enterSubnote(self)

        def exitRule(self, listener:ParseTreeListener):
            if hasattr( listener, "exitSubnote" ):
                listener.exitSubnote(self)




    def subnote(self):

        localctx = ZorgFileParser.SubnoteContext(self, self._ctx, self.state)
        self.enterRule(localctx, 20, self.RULE_subnote)
        self._la = 0 # Token type
        try:
            self.enterOuterAlt(localctx, 1)
            self.state = 185
            self.match(ZorgFileParser.TWO_SPACE_DASH)
            self.state = 186
            self.base_note()
            self.state = 190
            self._errHandler.sync(self)
            _la = self._input.LA(1)
            while _la==16:
                self.state = 187
                self.subsubnote()
                self.state = 192
                self._errHandler.sync(self)
                _la = self._input.LA(1)

        except RecognitionException as re:
            localctx.exception = re
            self._errHandler.reportError(self, re)
            self._errHandler.recover(self, re)
        finally:
            self.exitRule()
        return localctx


    class SubsubnoteContext(ParserRuleContext):
        __slots__ = 'parser'

        def __init__(self, parser, parent:ParserRuleContext=None, invokingState:int=-1):
            super().__init__(parent, invokingState)
            self.parser = parser

        def FOUR_SPACE_DASH(self):
            return self.getToken(ZorgFileParser.FOUR_SPACE_DASH, 0)

        def base_note(self):
            return self.getTypedRuleContext(ZorgFileParser.Base_noteContext,0)


        def getRuleIndex(self):
            return ZorgFileParser.RULE_subsubnote

        def enterRule(self, listener:ParseTreeListener):
            if hasattr( listener, "enterSubsubnote" ):
                listener.enterSubsubnote(self)

        def exitRule(self, listener:ParseTreeListener):
            if hasattr( listener, "exitSubsubnote" ):
                listener.exitSubsubnote(self)




    def subsubnote(self):

        localctx = ZorgFileParser.SubsubnoteContext(self, self._ctx, self.state)
        self.enterRule(localctx, 22, self.RULE_subsubnote)
        try:
            self.enterOuterAlt(localctx, 1)
            self.state = 193
            self.match(ZorgFileParser.FOUR_SPACE_DASH)
            self.state = 194
            self.base_note()
        except RecognitionException as re:
            localctx.exception = re
            self._errHandler.reportError(self, re)
            self._errHandler.recover(self, re)
        finally:
            self.exitRule()
        return localctx


    class TodoContext(ParserRuleContext):
        __slots__ = 'parser'

        def __init__(self, parser, parent:ParserRuleContext=None, invokingState:int=-1):
            super().__init__(parent, invokingState)
            self.parser = parser

        def base_todo(self):
            return self.getTypedRuleContext(ZorgFileParser.Base_todoContext,0)


        def subnote(self, i:int=None):
            if i is None:
                return self.getTypedRuleContexts(ZorgFileParser.SubnoteContext)
            else:
                return self.getTypedRuleContext(ZorgFileParser.SubnoteContext,i)


        def getRuleIndex(self):
            return ZorgFileParser.RULE_todo

        def enterRule(self, listener:ParseTreeListener):
            if hasattr( listener, "enterTodo" ):
                listener.enterTodo(self)

        def exitRule(self, listener:ParseTreeListener):
            if hasattr( listener, "exitTodo" ):
                listener.exitTodo(self)




    def todo(self):

        localctx = ZorgFileParser.TodoContext(self, self._ctx, self.state)
        self.enterRule(localctx, 24, self.RULE_todo)
        self._la = 0 # Token type
        try:
            self.enterOuterAlt(localctx, 1)
            self.state = 196
            self.base_todo()
            self.state = 200
            self._errHandler.sync(self)
            _la = self._input.LA(1)
            while _la==15:
                self.state = 197
                self.subnote()
                self.state = 202
                self._errHandler.sync(self)
                _la = self._input.LA(1)

        except RecognitionException as re:
            localctx.exception = re
            self._errHandler.reportError(self, re)
            self._errHandler.recover(self, re)
        finally:
            self.exitRule()
        return localctx


    class Base_todoContext(ParserRuleContext):
        __slots__ = 'parser'

        def __init__(self, parser, parent:ParserRuleContext=None, invokingState:int=-1):
            super().__init__(parent, invokingState)
            self.parser = parser

        def todo_prefix(self):
            return self.getTypedRuleContext(ZorgFileParser.Todo_prefixContext,0)


        def id_note_body(self):
            return self.getTypedRuleContext(ZorgFileParser.Id_note_bodyContext,0)


        def NL(self):
            return self.getToken(ZorgFileParser.NL, 0)

        def SPACE(self):
            return self.getToken(ZorgFileParser.SPACE, 0)

        def priority(self):
            return self.getTypedRuleContext(ZorgFileParser.PriorityContext,0)


        def getRuleIndex(self):
            return ZorgFileParser.RULE_base_todo

        def enterRule(self, listener:ParseTreeListener):
            if hasattr( listener, "enterBase_todo" ):
                listener.enterBase_todo(self)

        def exitRule(self, listener:ParseTreeListener):
            if hasattr( listener, "exitBase_todo" ):
                listener.exitBase_todo(self)




    def base_todo(self):

        localctx = ZorgFileParser.Base_todoContext(self, self._ctx, self.state)
        self.enterRule(localctx, 26, self.RULE_base_todo)
        try:
            self.enterOuterAlt(localctx, 1)
            self.state = 203
            self.todo_prefix()
            self.state = 206
            self._errHandler.sync(self)
            la_ = self._interp.adaptivePredict(self._input,16,self._ctx)
            if la_ == 1:
                self.state = 204
                self.match(ZorgFileParser.SPACE)
                self.state = 205
                self.priority()


            self.state = 208
            self.id_note_body()
            self.state = 209
            self.match(ZorgFileParser.NL)
        except RecognitionException as re:
            localctx.exception = re
            self._errHandler.reportError(self, re)
            self._errHandler.recover(self, re)
        finally:
            self.exitRule()
        return localctx


    class Todo_prefixContext(ParserRuleContext):
        __slots__ = 'parser'

        def __init__(self, parser, parent:ParserRuleContext=None, invokingState:int=-1):
            super().__init__(parent, invokingState)
            self.parser = parser

        def LOWER_O(self):
            return self.getToken(ZorgFileParser.LOWER_O, 0)

        def x_or_tilde(self):
            return self.getTypedRuleContext(ZorgFileParser.X_or_tildeContext,0)


        def LANGLE(self):
            return self.getToken(ZorgFileParser.LANGLE, 0)

        def RANGLE(self):
            return self.getToken(ZorgFileParser.RANGLE, 0)

        def getRuleIndex(self):
            return ZorgFileParser.RULE_todo_prefix

        def enterRule(self, listener:ParseTreeListener):
            if hasattr( listener, "enterTodo_prefix" ):
                listener.enterTodo_prefix(self)

        def exitRule(self, listener:ParseTreeListener):
            if hasattr( listener, "exitTodo_prefix" ):
                listener.exitTodo_prefix(self)




    def todo_prefix(self):

        localctx = ZorgFileParser.Todo_prefixContext(self, self._ctx, self.state)
        self.enterRule(localctx, 28, self.RULE_todo_prefix)
        try:
            self.enterOuterAlt(localctx, 1)
            self.state = 215
            self._errHandler.sync(self)
            token = self._input.LA(1)
            if token in [8]:
                self.state = 211
                self.match(ZorgFileParser.LOWER_O)
                pass
            elif token in [9, 32]:
                self.state = 212
                self.x_or_tilde()
                pass
            elif token in [34]:
                self.state = 213
                self.match(ZorgFileParser.LANGLE)
                pass
            elif token in [35]:
                self.state = 214
                self.match(ZorgFileParser.RANGLE)
                pass
            else:
                raise NoViableAltException(self)

        except RecognitionException as re:
            localctx.exception = re
            self._errHandler.reportError(self, re)
            self._errHandler.recover(self, re)
        finally:
            self.exitRule()
        return localctx


    class X_or_tildeContext(ParserRuleContext):
        __slots__ = 'parser'

        def __init__(self, parser, parent:ParserRuleContext=None, invokingState:int=-1):
            super().__init__(parent, invokingState)
            self.parser = parser

        def LOWER_X(self):
            return self.getToken(ZorgFileParser.LOWER_X, 0)

        def TILDE(self):
            return self.getToken(ZorgFileParser.TILDE, 0)

        def COLON(self):
            return self.getToken(ZorgFileParser.COLON, 0)

        def time(self):
            return self.getTypedRuleContext(ZorgFileParser.TimeContext,0)


        def getRuleIndex(self):
            return ZorgFileParser.RULE_x_or_tilde

        def enterRule(self, listener:ParseTreeListener):
            if hasattr( listener, "enterX_or_tilde" ):
                listener.enterX_or_tilde(self)

        def exitRule(self, listener:ParseTreeListener):
            if hasattr( listener, "exitX_or_tilde" ):
                listener.exitX_or_tilde(self)




    def x_or_tilde(self):

        localctx = ZorgFileParser.X_or_tildeContext(self, self._ctx, self.state)
        self.enterRule(localctx, 30, self.RULE_x_or_tilde)
        self._la = 0 # Token type
        try:
            self.enterOuterAlt(localctx, 1)
            self.state = 217
            _la = self._input.LA(1)
            if not(_la==9 or _la==32):
                self._errHandler.recoverInline(self)
            else:
                self._errHandler.reportMatch(self)
                self.consume()
            self.state = 220
            self._errHandler.sync(self)
            _la = self._input.LA(1)
            if _la==22:
                self.state = 218
                self.match(ZorgFileParser.COLON)
                self.state = 219
                self.time()


        except RecognitionException as re:
            localctx.exception = re
            self._errHandler.reportError(self, re)
            self._errHandler.recover(self, re)
        finally:
            self.exitRule()
        return localctx


    class PriorityContext(ParserRuleContext):
        __slots__ = 'parser'

        def __init__(self, parser, parent:ParserRuleContext=None, invokingState:int=-1):
            super().__init__(parent, invokingState)
            self.parser = parser

        def HASH(self):
            return self.getToken(ZorgFileParser.HASH, 0)

        def ID(self):
            return self.getToken(ZorgFileParser.ID, 0)

        def getRuleIndex(self):
            return ZorgFileParser.RULE_priority

        def enterRule(self, listener:ParseTreeListener):
            if hasattr( listener, "enterPriority" ):
                listener.enterPriority(self)

        def exitRule(self, listener:ParseTreeListener):
            if hasattr( listener, "exitPriority" ):
                listener.exitPriority(self)




    def priority(self):

        localctx = ZorgFileParser.PriorityContext(self, self._ctx, self.state)
        self.enterRule(localctx, 32, self.RULE_priority)
        try:
            self.enterOuterAlt(localctx, 1)
            self.state = 222
            self.match(ZorgFileParser.T__0)
            self.state = 223
            self.match(ZorgFileParser.HASH)
            self.state = 224
            self.match(ZorgFileParser.ID)
            self.state = 225
            self.match(ZorgFileParser.T__1)
        except RecognitionException as re:
            localctx.exception = re
            self._errHandler.reportError(self, re)
            self._errHandler.recover(self, re)
        finally:
            self.exitRule()
        return localctx


    class ZidContext(ParserRuleContext):
        __slots__ = 'parser'

        def __init__(self, parser, parent:ParserRuleContext=None, invokingState:int=-1):
            super().__init__(parent, invokingState)
            self.parser = parser

        def ZID(self):
            return self.getToken(ZorgFileParser.ZID, 0)

        def getRuleIndex(self):
            return ZorgFileParser.RULE_zid

        def enterRule(self, listener:ParseTreeListener):
            if hasattr( listener, "enterZid" ):
                listener.enterZid(self)

        def exitRule(self, listener:ParseTreeListener):
            if hasattr( listener, "exitZid" ):
                listener.exitZid(self)




    def zid(self):

        localctx = ZorgFileParser.ZidContext(self, self._ctx, self.state)
        self.enterRule(localctx, 34, self.RULE_zid)
        try:
            self.enterOuterAlt(localctx, 1)
            self.state = 227
            self.match(ZorgFileParser.ZID)
        except RecognitionException as re:
            localctx.exception = re
            self._errHandler.reportError(self, re)
            self._errHandler.recover(self, re)
        finally:
            self.exitRule()
        return localctx


    class Space_atomsContext(ParserRuleContext):
        __slots__ = 'parser'

        def __init__(self, parser, parent:ParserRuleContext=None, invokingState:int=-1):
            super().__init__(parent, invokingState)
            self.parser = parser

        def space_atom(self, i:int=None):
            if i is None:
                return self.getTypedRuleContexts(ZorgFileParser.Space_atomContext)
            else:
                return self.getTypedRuleContext(ZorgFileParser.Space_atomContext,i)


        def getRuleIndex(self):
            return ZorgFileParser.RULE_space_atoms

        def enterRule(self, listener:ParseTreeListener):
            if hasattr( listener, "enterSpace_atoms" ):
                listener.enterSpace_atoms(self)

        def exitRule(self, listener:ParseTreeListener):
            if hasattr( listener, "exitSpace_atoms" ):
                listener.exitSpace_atoms(self)




    def space_atoms(self):

        localctx = ZorgFileParser.Space_atomsContext(self, self._ctx, self.state)
        self.enterRule(localctx, 36, self.RULE_space_atoms)
        self._la = 0 # Token type
        try:
            self.enterOuterAlt(localctx, 1)
            self.state = 230 
            self._errHandler.sync(self)
            _la = self._input.LA(1)
            while True:
                self.state = 229
                self.space_atom()
                self.state = 232 
                self._errHandler.sync(self)
                _la = self._input.LA(1)
                if not (_la==23):
                    break

        except RecognitionException as re:
            localctx.exception = re
            self._errHandler.reportError(self, re)
            self._errHandler.recover(self, re)
        finally:
            self.exitRule()
        return localctx


    class Space_atomContext(ParserRuleContext):
        __slots__ = 'parser'

        def __init__(self, parser, parent:ParserRuleContext=None, invokingState:int=-1):
            super().__init__(parent, invokingState)
            self.parser = parser

        def SPACE(self):
            return self.getToken(ZorgFileParser.SPACE, 0)

        def SQUOTE(self):
            return self.getToken(ZorgFileParser.SQUOTE, 0)

        def non_tag_symbol(self, i:int=None):
            if i is None:
                return self.getTypedRuleContexts(ZorgFileParser.Non_tag_symbolContext)
            else:
                return self.getTypedRuleContext(ZorgFileParser.Non_tag_symbolContext,i)


        def DQUOTE(self, i:int=None):
            if i is None:
                return self.getTokens(ZorgFileParser.DQUOTE)
            else:
                return self.getToken(ZorgFileParser.DQUOTE, i)

        def atom(self):
            return self.getTypedRuleContext(ZorgFileParser.AtomContext,0)


        def quoted(self):
            return self.getTypedRuleContext(ZorgFileParser.QuotedContext,0)


        def any_symbol(self, i:int=None):
            if i is None:
                return self.getTypedRuleContexts(ZorgFileParser.Any_symbolContext)
            else:
                return self.getTypedRuleContext(ZorgFileParser.Any_symbolContext,i)


        def ref(self):
            return self.getTypedRuleContext(ZorgFileParser.RefContext,0)


        def id_(self, i:int=None):
            if i is None:
                return self.getTypedRuleContexts(ZorgFileParser.IdContext)
            else:
                return self.getTypedRuleContext(ZorgFileParser.IdContext,i)


        def getRuleIndex(self):
            return ZorgFileParser.RULE_space_atom

        def enterRule(self, listener:ParseTreeListener):
            if hasattr( listener, "enterSpace_atom" ):
                listener.enterSpace_atom(self)

        def exitRule(self, listener:ParseTreeListener):
            if hasattr( listener, "exitSpace_atom" ):
                listener.exitSpace_atom(self)




    def space_atom(self):

        localctx = ZorgFileParser.Space_atomContext(self, self._ctx, self.state)
        self.enterRule(localctx, 38, self.RULE_space_atom)
        self._la = 0 # Token type
        try:
            self.enterOuterAlt(localctx, 1)
            self.state = 234
            self.match(ZorgFileParser.SPACE)
            self.state = 237
            self._errHandler.sync(self)
            la_ = self._interp.adaptivePredict(self._input,20,self._ctx)
            if la_ == 1:
                self.state = 235
                self.match(ZorgFileParser.SQUOTE)
                self.state = 236
                self.non_tag_symbol()


            self.state = 243
            self._errHandler.sync(self)
            _alt = self._interp.adaptivePredict(self._input,22,self._ctx)
            while _alt!=2 and _alt!=ATN.INVALID_ALT_NUMBER:
                if _alt==1:
                    self.state = 241
                    self._errHandler.sync(self)
                    token = self._input.LA(1)
                    if token in [17, 21, 24, 25, 32, 33, 34, 35]:
                        self.state = 239
                        self.non_tag_symbol()
                        pass
                    elif token in [31]:
                        self.state = 240
                        self.match(ZorgFileParser.DQUOTE)
                        pass
                    else:
                        raise NoViableAltException(self)
             
                self.state = 245
                self._errHandler.sync(self)
                _alt = self._interp.adaptivePredict(self._input,22,self._ctx)

            self.state = 248
            self._errHandler.sync(self)
            la_ = self._interp.adaptivePredict(self._input,23,self._ctx)
            if la_ == 1:
                self.state = 246
                self.atom()

            elif la_ == 2:
                self.state = 247
                self.quoted()


            self.state = 258
            self._errHandler.sync(self)
            _la = self._input.LA(1)
            if (((_la) & ~0x3f) == 0 and ((1 << _la) & 68710957056) != 0):
                self.state = 250
                self.any_symbol()
                self.state = 255
                self._errHandler.sync(self)
                _la = self._input.LA(1)
                while (((_la) & ~0x3f) == 0 and ((1 << _la) & 68710981376) != 0):
                    self.state = 253
                    self._errHandler.sync(self)
                    token = self._input.LA(1)
                    if token in [17, 18, 19, 20, 21, 22, 24, 25, 26, 27, 28, 29, 30, 31, 32, 33, 34, 35]:
                        self.state = 251
                        self.any_symbol()
                        pass
                    elif token in [8, 9, 10, 11, 12, 14]:
                        self.state = 252
                        self.id_()
                        pass
                    else:
                        raise NoViableAltException(self)

                    self.state = 257
                    self._errHandler.sync(self)
                    _la = self._input.LA(1)



            self.state = 261
            self._errHandler.sync(self)
            _la = self._input.LA(1)
            if _la==1:
                self.state = 260
                self.ref()


        except RecognitionException as re:
            localctx.exception = re
            self._errHandler.reportError(self, re)
            self._errHandler.recover(self, re)
        finally:
            self.exitRule()
        return localctx


    class AtomContext(ParserRuleContext):
        __slots__ = 'parser'

        def __init__(self, parser, parent:ParserRuleContext=None, invokingState:int=-1):
            super().__init__(parent, invokingState)
            self.parser = parser

        def tag_symbol(self):
            return self.getTypedRuleContext(ZorgFileParser.Tag_symbolContext,0)


        def tag(self):
            return self.getTypedRuleContext(ZorgFileParser.TagContext,0)


        def link(self):
            return self.getTypedRuleContext(ZorgFileParser.LinkContext,0)


        def property_(self):
            return self.getTypedRuleContext(ZorgFileParser.PropertyContext,0)


        def id_group(self):
            return self.getTypedRuleContext(ZorgFileParser.Id_groupContext,0)


        def ref(self):
            return self.getTypedRuleContext(ZorgFileParser.RefContext,0)


        def zid(self):
            return self.getTypedRuleContext(ZorgFileParser.ZidContext,0)


        def priority(self):
            return self.getTypedRuleContext(ZorgFileParser.PriorityContext,0)


        def getRuleIndex(self):
            return ZorgFileParser.RULE_atom

        def enterRule(self, listener:ParseTreeListener):
            if hasattr( listener, "enterAtom" ):
                listener.enterAtom(self)

        def exitRule(self, listener:ParseTreeListener):
            if hasattr( listener, "exitAtom" ):
                listener.exitAtom(self)




    def atom(self):

        localctx = ZorgFileParser.AtomContext(self, self._ctx, self.state)
        self.enterRule(localctx, 40, self.RULE_atom)
        try:
            self.state = 271
            self._errHandler.sync(self)
            la_ = self._interp.adaptivePredict(self._input,28,self._ctx)
            if la_ == 1:
                self.enterOuterAlt(localctx, 1)
                self.state = 263
                self.tag_symbol()
                pass

            elif la_ == 2:
                self.enterOuterAlt(localctx, 2)
                self.state = 264
                self.tag()
                pass

            elif la_ == 3:
                self.enterOuterAlt(localctx, 3)
                self.state = 265
                self.link()
                pass

            elif la_ == 4:
                self.enterOuterAlt(localctx, 4)
                self.state = 266
                self.property_()
                pass

            elif la_ == 5:
                self.enterOuterAlt(localctx, 5)
                self.state = 267
                self.id_group()
                pass

            elif la_ == 6:
                self.enterOuterAlt(localctx, 6)
                self.state = 268
                self.ref()
                pass

            elif la_ == 7:
                self.enterOuterAlt(localctx, 7)
                self.state = 269
                self.zid()
                pass

            elif la_ == 8:
                self.enterOuterAlt(localctx, 8)
                self.state = 270
                self.priority()
                pass


        except RecognitionException as re:
            localctx.exception = re
            self._errHandler.reportError(self, re)
            self._errHandler.recover(self, re)
        finally:
            self.exitRule()
        return localctx


    class PropertyContext(ParserRuleContext):
        __slots__ = 'parser'

        def __init__(self, parser, parent:ParserRuleContext=None, invokingState:int=-1):
            super().__init__(parent, invokingState)
            self.parser = parser

        def ID(self):
            return self.getToken(ZorgFileParser.ID, 0)

        def COLON(self, i:int=None):
            if i is None:
                return self.getTokens(ZorgFileParser.COLON)
            else:
                return self.getToken(ZorgFileParser.COLON, i)

        def id_group(self):
            return self.getTypedRuleContext(ZorgFileParser.Id_groupContext,0)


        def getRuleIndex(self):
            return ZorgFileParser.RULE_property

        def enterRule(self, listener:ParseTreeListener):
            if hasattr( listener, "enterProperty" ):
                listener.enterProperty(self)

        def exitRule(self, listener:ParseTreeListener):
            if hasattr( listener, "exitProperty" ):
                listener.exitProperty(self)




    def property_(self):

        localctx = ZorgFileParser.PropertyContext(self, self._ctx, self.state)
        self.enterRule(localctx, 42, self.RULE_property)
        try:
            self.enterOuterAlt(localctx, 1)
            self.state = 273
            self.match(ZorgFileParser.ID)
            self.state = 274
            self.match(ZorgFileParser.COLON)
            self.state = 275
            self.match(ZorgFileParser.COLON)
            self.state = 276
            self.id_group()
        except RecognitionException as re:
            localctx.exception = re
            self._errHandler.reportError(self, re)
            self._errHandler.recover(self, re)
        finally:
            self.exitRule()
        return localctx


    class Id_groupContext(ParserRuleContext):
        __slots__ = 'parser'

        def __init__(self, parser, parent:ParserRuleContext=None, invokingState:int=-1):
            super().__init__(parent, invokingState)
            self.parser = parser

        def id_(self, i:int=None):
            if i is None:
                return self.getTypedRuleContexts(ZorgFileParser.IdContext)
            else:
                return self.getTypedRuleContext(ZorgFileParser.IdContext,i)


        def id_symbol(self, i:int=None):
            if i is None:
                return self.getTypedRuleContexts(ZorgFileParser.Id_symbolContext)
            else:
                return self.getTypedRuleContext(ZorgFileParser.Id_symbolContext,i)


        def getRuleIndex(self):
            return ZorgFileParser.RULE_id_group

        def enterRule(self, listener:ParseTreeListener):
            if hasattr( listener, "enterId_group" ):
                listener.enterId_group(self)

        def exitRule(self, listener:ParseTreeListener):
            if hasattr( listener, "exitId_group" ):
                listener.exitId_group(self)




    def id_group(self):

        localctx = ZorgFileParser.Id_groupContext(self, self._ctx, self.state)
        self.enterRule(localctx, 44, self.RULE_id_group)
        self._la = 0 # Token type
        try:
            self.enterOuterAlt(localctx, 1)
            self.state = 278
            self.id_()
            self.state = 288
            self._errHandler.sync(self)
            _alt = self._interp.adaptivePredict(self._input,30,self._ctx)
            while _alt!=2 and _alt!=ATN.INVALID_ALT_NUMBER:
                if _alt==1:
                    self.state = 280 
                    self._errHandler.sync(self)
                    _la = self._input.LA(1)
                    while True:
                        self.state = 279
                        self.id_symbol()
                        self.state = 282 
                        self._errHandler.sync(self)
                        _la = self._input.LA(1)
                        if not ((((_la) & ~0x3f) == 0 and ((1 << _la) & 6029312) != 0)):
                            break

                    self.state = 284
                    self.id_() 
                self.state = 290
                self._errHandler.sync(self)
                _alt = self._interp.adaptivePredict(self._input,30,self._ctx)

        except RecognitionException as re:
            localctx.exception = re
            self._errHandler.reportError(self, re)
            self._errHandler.recover(self, re)
        finally:
            self.exitRule()
        return localctx


    class IdContext(ParserRuleContext):
        __slots__ = 'parser'

        def __init__(self, parser, parent:ParserRuleContext=None, invokingState:int=-1):
            super().__init__(parent, invokingState)
            self.parser = parser

        def ID(self):
            return self.getToken(ZorgFileParser.ID, 0)

        def NUM_ID(self):
            return self.getToken(ZorgFileParser.NUM_ID, 0)

        def date(self):
            return self.getTypedRuleContext(ZorgFileParser.DateContext,0)


        def time(self):
            return self.getTypedRuleContext(ZorgFileParser.TimeContext,0)


        def LOWER_O(self):
            return self.getToken(ZorgFileParser.LOWER_O, 0)

        def LOWER_X(self):
            return self.getToken(ZorgFileParser.LOWER_X, 0)

        def getRuleIndex(self):
            return ZorgFileParser.RULE_id

        def enterRule(self, listener:ParseTreeListener):
            if hasattr( listener, "enterId" ):
                listener.enterId(self)

        def exitRule(self, listener:ParseTreeListener):
            if hasattr( listener, "exitId" ):
                listener.exitId(self)




    def id_(self):

        localctx = ZorgFileParser.IdContext(self, self._ctx, self.state)
        self.enterRule(localctx, 46, self.RULE_id)
        try:
            self.state = 297
            self._errHandler.sync(self)
            token = self._input.LA(1)
            if token in [10]:
                self.enterOuterAlt(localctx, 1)
                self.state = 291
                self.match(ZorgFileParser.ID)
                pass
            elif token in [14]:
                self.enterOuterAlt(localctx, 2)
                self.state = 292
                self.match(ZorgFileParser.NUM_ID)
                pass
            elif token in [11]:
                self.enterOuterAlt(localctx, 3)
                self.state = 293
                self.date()
                pass
            elif token in [12]:
                self.enterOuterAlt(localctx, 4)
                self.state = 294
                self.time()
                pass
            elif token in [8]:
                self.enterOuterAlt(localctx, 5)
                self.state = 295
                self.match(ZorgFileParser.LOWER_O)
                pass
            elif token in [9]:
                self.enterOuterAlt(localctx, 6)
                self.state = 296
                self.match(ZorgFileParser.LOWER_X)
                pass
            else:
                raise NoViableAltException(self)

        except RecognitionException as re:
            localctx.exception = re
            self._errHandler.reportError(self, re)
            self._errHandler.recover(self, re)
        finally:
            self.exitRule()
        return localctx


    class DateContext(ParserRuleContext):
        __slots__ = 'parser'

        def __init__(self, parser, parent:ParserRuleContext=None, invokingState:int=-1):
            super().__init__(parent, invokingState)
            self.parser = parser

        def DATE(self):
            return self.getToken(ZorgFileParser.DATE, 0)

        def getRuleIndex(self):
            return ZorgFileParser.RULE_date

        def enterRule(self, listener:ParseTreeListener):
            if hasattr( listener, "enterDate" ):
                listener.enterDate(self)

        def exitRule(self, listener:ParseTreeListener):
            if hasattr( listener, "exitDate" ):
                listener.exitDate(self)




    def date(self):

        localctx = ZorgFileParser.DateContext(self, self._ctx, self.state)
        self.enterRule(localctx, 48, self.RULE_date)
        try:
            self.enterOuterAlt(localctx, 1)
            self.state = 299
            self.match(ZorgFileParser.DATE)
        except RecognitionException as re:
            localctx.exception = re
            self._errHandler.reportError(self, re)
            self._errHandler.recover(self, re)
        finally:
            self.exitRule()
        return localctx


    class TimeContext(ParserRuleContext):
        __slots__ = 'parser'

        def __init__(self, parser, parent:ParserRuleContext=None, invokingState:int=-1):
            super().__init__(parent, invokingState)
            self.parser = parser

        def TIME(self):
            return self.getToken(ZorgFileParser.TIME, 0)

        def getRuleIndex(self):
            return ZorgFileParser.RULE_time

        def enterRule(self, listener:ParseTreeListener):
            if hasattr( listener, "enterTime" ):
                listener.enterTime(self)

        def exitRule(self, listener:ParseTreeListener):
            if hasattr( listener, "exitTime" ):
                listener.exitTime(self)




    def time(self):

        localctx = ZorgFileParser.TimeContext(self, self._ctx, self.state)
        self.enterRule(localctx, 50, self.RULE_time)
        try:
            self.enterOuterAlt(localctx, 1)
            self.state = 301
            self.match(ZorgFileParser.TIME)
        except RecognitionException as re:
            localctx.exception = re
            self._errHandler.reportError(self, re)
            self._errHandler.recover(self, re)
        finally:
            self.exitRule()
        return localctx


    class Any_symbolContext(ParserRuleContext):
        __slots__ = 'parser'

        def __init__(self, parser, parent:ParserRuleContext=None, invokingState:int=-1):
            super().__init__(parent, invokingState)
            self.parser = parser

        def SQUOTE(self):
            return self.getToken(ZorgFileParser.SQUOTE, 0)

        def DQUOTE(self):
            return self.getToken(ZorgFileParser.DQUOTE, 0)

        def non_tag_symbol(self):
            return self.getTypedRuleContext(ZorgFileParser.Non_tag_symbolContext,0)


        def tag_symbol(self):
            return self.getTypedRuleContext(ZorgFileParser.Tag_symbolContext,0)


        def id_symbol(self):
            return self.getTypedRuleContext(ZorgFileParser.Id_symbolContext,0)


        def getRuleIndex(self):
            return ZorgFileParser.RULE_any_symbol

        def enterRule(self, listener:ParseTreeListener):
            if hasattr( listener, "enterAny_symbol" ):
                listener.enterAny_symbol(self)

        def exitRule(self, listener:ParseTreeListener):
            if hasattr( listener, "exitAny_symbol" ):
                listener.exitAny_symbol(self)




    def any_symbol(self):

        localctx = ZorgFileParser.Any_symbolContext(self, self._ctx, self.state)
        self.enterRule(localctx, 52, self.RULE_any_symbol)
        try:
            self.state = 308
            self._errHandler.sync(self)
            token = self._input.LA(1)
            if token in [30]:
                self.enterOuterAlt(localctx, 1)
                self.state = 303
                self.match(ZorgFileParser.SQUOTE)
                pass
            elif token in [31]:
                self.enterOuterAlt(localctx, 2)
                self.state = 304
                self.match(ZorgFileParser.DQUOTE)
                pass
            elif token in [17, 21, 24, 25, 32, 33, 34, 35]:
                self.enterOuterAlt(localctx, 3)
                self.state = 305
                self.non_tag_symbol()
                pass
            elif token in [26, 27, 28, 29]:
                self.enterOuterAlt(localctx, 4)
                self.state = 306
                self.tag_symbol()
                pass
            elif token in [18, 19, 20, 22]:
                self.enterOuterAlt(localctx, 5)
                self.state = 307
                self.id_symbol()
                pass
            else:
                raise NoViableAltException(self)

        except RecognitionException as re:
            localctx.exception = re
            self._errHandler.reportError(self, re)
            self._errHandler.recover(self, re)
        finally:
            self.exitRule()
        return localctx


    class Non_tag_symbolContext(ParserRuleContext):
        __slots__ = 'parser'

        def __init__(self, parser, parent:ParserRuleContext=None, invokingState:int=-1):
            super().__init__(parent, invokingState)
            self.parser = parser

        def LANGLE(self):
            return self.getToken(ZorgFileParser.LANGLE, 0)

        def RANGLE(self):
            return self.getToken(ZorgFileParser.RANGLE, 0)

        def STAR(self):
            return self.getToken(ZorgFileParser.STAR, 0)

        def TILDE(self):
            return self.getToken(ZorgFileParser.TILDE, 0)

        def SYMBOL(self):
            return self.getToken(ZorgFileParser.SYMBOL, 0)

        def LPAREN(self):
            return self.getToken(ZorgFileParser.LPAREN, 0)

        def RPAREN(self):
            return self.getToken(ZorgFileParser.RPAREN, 0)

        def UNDERSCORE(self):
            return self.getToken(ZorgFileParser.UNDERSCORE, 0)

        def getRuleIndex(self):
            return ZorgFileParser.RULE_non_tag_symbol

        def enterRule(self, listener:ParseTreeListener):
            if hasattr( listener, "enterNon_tag_symbol" ):
                listener.enterNon_tag_symbol(self)

        def exitRule(self, listener:ParseTreeListener):
            if hasattr( listener, "exitNon_tag_symbol" ):
                listener.exitNon_tag_symbol(self)




    def non_tag_symbol(self):

        localctx = ZorgFileParser.Non_tag_symbolContext(self, self._ctx, self.state)
        self.enterRule(localctx, 54, self.RULE_non_tag_symbol)
        self._la = 0 # Token type
        try:
            self.enterOuterAlt(localctx, 1)
            self.state = 310
            _la = self._input.LA(1)
            if not((((_la) & ~0x3f) == 0 and ((1 << _la) & 64477069312) != 0)):
                self._errHandler.recoverInline(self)
            else:
                self._errHandler.reportMatch(self)
                self.consume()
        except RecognitionException as re:
            localctx.exception = re
            self._errHandler.reportError(self, re)
            self._errHandler.recover(self, re)
        finally:
            self.exitRule()
        return localctx


    class Id_symbolContext(ParserRuleContext):
        __slots__ = 'parser'

        def __init__(self, parser, parent:ParserRuleContext=None, invokingState:int=-1):
            super().__init__(parent, invokingState)
            self.parser = parser

        def DASH(self):
            return self.getToken(ZorgFileParser.DASH, 0)

        def DOT(self):
            return self.getToken(ZorgFileParser.DOT, 0)

        def FSLASH(self):
            return self.getToken(ZorgFileParser.FSLASH, 0)

        def COLON(self):
            return self.getToken(ZorgFileParser.COLON, 0)

        def getRuleIndex(self):
            return ZorgFileParser.RULE_id_symbol

        def enterRule(self, listener:ParseTreeListener):
            if hasattr( listener, "enterId_symbol" ):
                listener.enterId_symbol(self)

        def exitRule(self, listener:ParseTreeListener):
            if hasattr( listener, "exitId_symbol" ):
                listener.exitId_symbol(self)




    def id_symbol(self):

        localctx = ZorgFileParser.Id_symbolContext(self, self._ctx, self.state)
        self.enterRule(localctx, 56, self.RULE_id_symbol)
        self._la = 0 # Token type
        try:
            self.enterOuterAlt(localctx, 1)
            self.state = 312
            _la = self._input.LA(1)
            if not((((_la) & ~0x3f) == 0 and ((1 << _la) & 6029312) != 0)):
                self._errHandler.recoverInline(self)
            else:
                self._errHandler.reportMatch(self)
                self.consume()
        except RecognitionException as re:
            localctx.exception = re
            self._errHandler.reportError(self, re)
            self._errHandler.recover(self, re)
        finally:
            self.exitRule()
        return localctx


    class Tag_symbolContext(ParserRuleContext):
        __slots__ = 'parser'

        def __init__(self, parser, parent:ParserRuleContext=None, invokingState:int=-1):
            super().__init__(parent, invokingState)
            self.parser = parser

        def HASH(self):
            return self.getToken(ZorgFileParser.HASH, 0)

        def AT_SIGN(self):
            return self.getToken(ZorgFileParser.AT_SIGN, 0)

        def PERCENT(self):
            return self.getToken(ZorgFileParser.PERCENT, 0)

        def PLUS(self):
            return self.getToken(ZorgFileParser.PLUS, 0)

        def getRuleIndex(self):
            return ZorgFileParser.RULE_tag_symbol

        def enterRule(self, listener:ParseTreeListener):
            if hasattr( listener, "enterTag_symbol" ):
                listener.enterTag_symbol(self)

        def exitRule(self, listener:ParseTreeListener):
            if hasattr( listener, "exitTag_symbol" ):
                listener.exitTag_symbol(self)




    def tag_symbol(self):

        localctx = ZorgFileParser.Tag_symbolContext(self, self._ctx, self.state)
        self.enterRule(localctx, 58, self.RULE_tag_symbol)
        self._la = 0 # Token type
        try:
            self.enterOuterAlt(localctx, 1)
            self.state = 314
            _la = self._input.LA(1)
            if not((((_la) & ~0x3f) == 0 and ((1 << _la) & 1006632960) != 0)):
                self._errHandler.recoverInline(self)
            else:
                self._errHandler.reportMatch(self)
                self.consume()
        except RecognitionException as re:
            localctx.exception = re
            self._errHandler.reportError(self, re)
            self._errHandler.recover(self, re)
        finally:
            self.exitRule()
        return localctx


    class TagContext(ParserRuleContext):
        __slots__ = 'parser'

        def __init__(self, parser, parent:ParserRuleContext=None, invokingState:int=-1):
            super().__init__(parent, invokingState)
            self.parser = parser

        def area(self):
            return self.getTypedRuleContext(ZorgFileParser.AreaContext,0)


        def context(self):
            return self.getTypedRuleContext(ZorgFileParser.ContextContext,0)


        def person(self):
            return self.getTypedRuleContext(ZorgFileParser.PersonContext,0)


        def project(self):
            return self.getTypedRuleContext(ZorgFileParser.ProjectContext,0)


        def getRuleIndex(self):
            return ZorgFileParser.RULE_tag

        def enterRule(self, listener:ParseTreeListener):
            if hasattr( listener, "enterTag" ):
                listener.enterTag(self)

        def exitRule(self, listener:ParseTreeListener):
            if hasattr( listener, "exitTag" ):
                listener.exitTag(self)




    def tag(self):

        localctx = ZorgFileParser.TagContext(self, self._ctx, self.state)
        self.enterRule(localctx, 60, self.RULE_tag)
        try:
            self.state = 320
            self._errHandler.sync(self)
            token = self._input.LA(1)
            if token in [26]:
                self.enterOuterAlt(localctx, 1)
                self.state = 316
                self.area()
                pass
            elif token in [27]:
                self.enterOuterAlt(localctx, 2)
                self.state = 317
                self.context()
                pass
            elif token in [29]:
                self.enterOuterAlt(localctx, 3)
                self.state = 318
                self.person()
                pass
            elif token in [28]:
                self.enterOuterAlt(localctx, 4)
                self.state = 319
                self.project()
                pass
            else:
                raise NoViableAltException(self)

        except RecognitionException as re:
            localctx.exception = re
            self._errHandler.reportError(self, re)
            self._errHandler.recover(self, re)
        finally:
            self.exitRule()
        return localctx


    class AreaContext(ParserRuleContext):
        __slots__ = 'parser'

        def __init__(self, parser, parent:ParserRuleContext=None, invokingState:int=-1):
            super().__init__(parent, invokingState)
            self.parser = parser

        def HASH(self):
            return self.getToken(ZorgFileParser.HASH, 0)

        def ID(self):
            return self.getToken(ZorgFileParser.ID, 0)

        def getRuleIndex(self):
            return ZorgFileParser.RULE_area

        def enterRule(self, listener:ParseTreeListener):
            if hasattr( listener, "enterArea" ):
                listener.enterArea(self)

        def exitRule(self, listener:ParseTreeListener):
            if hasattr( listener, "exitArea" ):
                listener.exitArea(self)




    def area(self):

        localctx = ZorgFileParser.AreaContext(self, self._ctx, self.state)
        self.enterRule(localctx, 62, self.RULE_area)
        try:
            self.enterOuterAlt(localctx, 1)
            self.state = 322
            self.match(ZorgFileParser.HASH)
            self.state = 323
            self.match(ZorgFileParser.ID)
        except RecognitionException as re:
            localctx.exception = re
            self._errHandler.reportError(self, re)
            self._errHandler.recover(self, re)
        finally:
            self.exitRule()
        return localctx


    class ContextContext(ParserRuleContext):
        __slots__ = 'parser'

        def __init__(self, parser, parent:ParserRuleContext=None, invokingState:int=-1):
            super().__init__(parent, invokingState)
            self.parser = parser

        def AT_SIGN(self):
            return self.getToken(ZorgFileParser.AT_SIGN, 0)

        def ID(self):
            return self.getToken(ZorgFileParser.ID, 0)

        def getRuleIndex(self):
            return ZorgFileParser.RULE_context

        def enterRule(self, listener:ParseTreeListener):
            if hasattr( listener, "enterContext" ):
                listener.enterContext(self)

        def exitRule(self, listener:ParseTreeListener):
            if hasattr( listener, "exitContext" ):
                listener.exitContext(self)




    def context(self):

        localctx = ZorgFileParser.ContextContext(self, self._ctx, self.state)
        self.enterRule(localctx, 64, self.RULE_context)
        try:
            self.enterOuterAlt(localctx, 1)
            self.state = 325
            self.match(ZorgFileParser.AT_SIGN)
            self.state = 326
            self.match(ZorgFileParser.ID)
        except RecognitionException as re:
            localctx.exception = re
            self._errHandler.reportError(self, re)
            self._errHandler.recover(self, re)
        finally:
            self.exitRule()
        return localctx


    class PersonContext(ParserRuleContext):
        __slots__ = 'parser'

        def __init__(self, parser, parent:ParserRuleContext=None, invokingState:int=-1):
            super().__init__(parent, invokingState)
            self.parser = parser

        def PERCENT(self):
            return self.getToken(ZorgFileParser.PERCENT, 0)

        def ID(self):
            return self.getToken(ZorgFileParser.ID, 0)

        def getRuleIndex(self):
            return ZorgFileParser.RULE_person

        def enterRule(self, listener:ParseTreeListener):
            if hasattr( listener, "enterPerson" ):
                listener.enterPerson(self)

        def exitRule(self, listener:ParseTreeListener):
            if hasattr( listener, "exitPerson" ):
                listener.exitPerson(self)




    def person(self):

        localctx = ZorgFileParser.PersonContext(self, self._ctx, self.state)
        self.enterRule(localctx, 66, self.RULE_person)
        try:
            self.enterOuterAlt(localctx, 1)
            self.state = 328
            self.match(ZorgFileParser.PERCENT)
            self.state = 329
            self.match(ZorgFileParser.ID)
        except RecognitionException as re:
            localctx.exception = re
            self._errHandler.reportError(self, re)
            self._errHandler.recover(self, re)
        finally:
            self.exitRule()
        return localctx


    class ProjectContext(ParserRuleContext):
        __slots__ = 'parser'

        def __init__(self, parser, parent:ParserRuleContext=None, invokingState:int=-1):
            super().__init__(parent, invokingState)
            self.parser = parser

        def PLUS(self):
            return self.getToken(ZorgFileParser.PLUS, 0)

        def ID(self):
            return self.getToken(ZorgFileParser.ID, 0)

        def getRuleIndex(self):
            return ZorgFileParser.RULE_project

        def enterRule(self, listener:ParseTreeListener):
            if hasattr( listener, "enterProject" ):
                listener.enterProject(self)

        def exitRule(self, listener:ParseTreeListener):
            if hasattr( listener, "exitProject" ):
                listener.exitProject(self)




    def project(self):

        localctx = ZorgFileParser.ProjectContext(self, self._ctx, self.state)
        self.enterRule(localctx, 68, self.RULE_project)
        try:
            self.enterOuterAlt(localctx, 1)
            self.state = 331
            self.match(ZorgFileParser.PLUS)
            self.state = 332
            self.match(ZorgFileParser.ID)
        except RecognitionException as re:
            localctx.exception = re
            self._errHandler.reportError(self, re)
            self._errHandler.recover(self, re)
        finally:
            self.exitRule()
        return localctx


    class QuotedContext(ParserRuleContext):
        __slots__ = 'parser'

        def __init__(self, parser, parent:ParserRuleContext=None, invokingState:int=-1):
            super().__init__(parent, invokingState)
            self.parser = parser

        def SQUOTE(self, i:int=None):
            if i is None:
                return self.getTokens(ZorgFileParser.SQUOTE)
            else:
                return self.getToken(ZorgFileParser.SQUOTE, i)

        def DQUOTE(self, i:int=None):
            if i is None:
                return self.getTokens(ZorgFileParser.DQUOTE)
            else:
                return self.getToken(ZorgFileParser.DQUOTE, i)

        def atom(self, i:int=None):
            if i is None:
                return self.getTypedRuleContexts(ZorgFileParser.AtomContext)
            else:
                return self.getTypedRuleContext(ZorgFileParser.AtomContext,i)


        def priority(self, i:int=None):
            if i is None:
                return self.getTypedRuleContexts(ZorgFileParser.PriorityContext)
            else:
                return self.getTypedRuleContext(ZorgFileParser.PriorityContext,i)


        def getRuleIndex(self):
            return ZorgFileParser.RULE_quoted

        def enterRule(self, listener:ParseTreeListener):
            if hasattr( listener, "enterQuoted" ):
                listener.enterQuoted(self)

        def exitRule(self, listener:ParseTreeListener):
            if hasattr( listener, "exitQuoted" ):
                listener.exitQuoted(self)




    def quoted(self):

        localctx = ZorgFileParser.QuotedContext(self, self._ctx, self.state)
        self.enterRule(localctx, 70, self.RULE_quoted)
        self._la = 0 # Token type
        try:
            self.enterOuterAlt(localctx, 1)
            self.state = 352
            self._errHandler.sync(self)
            token = self._input.LA(1)
            if token in [30]:
                self.state = 334
                self.match(ZorgFileParser.SQUOTE)
                self.state = 339 
                self._errHandler.sync(self)
                _la = self._input.LA(1)
                while True:
                    self.state = 339
                    self._errHandler.sync(self)
                    la_ = self._interp.adaptivePredict(self._input,34,self._ctx)
                    if la_ == 1:
                        self.state = 335
                        self.atom()
                        pass

                    elif la_ == 2:
                        self.state = 336
                        self.priority()
                        pass

                    elif la_ == 3:
                        self.state = 337
                        self.match(ZorgFileParser.T__2)
                        pass

                    elif la_ == 4:
                        self.state = 338
                        self.match(ZorgFileParser.T__3)
                        pass


                    self.state = 341 
                    self._errHandler.sync(self)
                    _la = self._input.LA(1)
                    if not ((((_la) & ~0x3f) == 0 and ((1 << _la) & 1006665498) != 0)):
                        break

                self.state = 343
                self.match(ZorgFileParser.SQUOTE)
                pass
            elif token in [31]:
                self.state = 344
                self.match(ZorgFileParser.DQUOTE)
                self.state = 346 
                self._errHandler.sync(self)
                _la = self._input.LA(1)
                while True:
                    self.state = 345
                    self.atom()
                    self.state = 348 
                    self._errHandler.sync(self)
                    _la = self._input.LA(1)
                    if not ((((_la) & ~0x3f) == 0 and ((1 << _la) & 1006665482) != 0)):
                        break

                self.state = 350
                self.match(ZorgFileParser.DQUOTE)
                pass
            else:
                raise NoViableAltException(self)

        except RecognitionException as re:
            localctx.exception = re
            self._errHandler.reportError(self, re)
            self._errHandler.recover(self, re)
        finally:
            self.exitRule()
        return localctx


    class LinkContext(ParserRuleContext):
        __slots__ = 'parser'

        def __init__(self, parser, parent:ParserRuleContext=None, invokingState:int=-1):
            super().__init__(parent, invokingState)
            self.parser = parser

        def id_group(self):
            return self.getTypedRuleContext(ZorgFileParser.Id_groupContext,0)


        def getRuleIndex(self):
            return ZorgFileParser.RULE_link

        def enterRule(self, listener:ParseTreeListener):
            if hasattr( listener, "enterLink" ):
                listener.enterLink(self)

        def exitRule(self, listener:ParseTreeListener):
            if hasattr( listener, "exitLink" ):
                listener.exitLink(self)




    def link(self):

        localctx = ZorgFileParser.LinkContext(self, self._ctx, self.state)
        self.enterRule(localctx, 72, self.RULE_link)
        try:
            self.enterOuterAlt(localctx, 1)
            self.state = 354
            self.match(ZorgFileParser.T__2)
            self.state = 355
            self.id_group()
            self.state = 356
            self.match(ZorgFileParser.T__3)
        except RecognitionException as re:
            localctx.exception = re
            self._errHandler.reportError(self, re)
            self._errHandler.recover(self, re)
        finally:
            self.exitRule()
        return localctx


    class RefContext(ParserRuleContext):
        __slots__ = 'parser'

        def __init__(self, parser, parent:ParserRuleContext=None, invokingState:int=-1):
            super().__init__(parent, invokingState)
            self.parser = parser

        def id_group(self):
            return self.getTypedRuleContext(ZorgFileParser.Id_groupContext,0)


        def getRuleIndex(self):
            return ZorgFileParser.RULE_ref

        def enterRule(self, listener:ParseTreeListener):
            if hasattr( listener, "enterRef" ):
                listener.enterRef(self)

        def exitRule(self, listener:ParseTreeListener):
            if hasattr( listener, "exitRef" ):
                listener.exitRef(self)




    def ref(self):

        localctx = ZorgFileParser.RefContext(self, self._ctx, self.state)
        self.enterRule(localctx, 74, self.RULE_ref)
        try:
            self.enterOuterAlt(localctx, 1)
            self.state = 358
            self.match(ZorgFileParser.T__0)
            self.state = 359
            self.id_group()
            self.state = 360
            self.match(ZorgFileParser.T__1)
        except RecognitionException as re:
            localctx.exception = re
            self._errHandler.reportError(self, re)
            self._errHandler.recover(self, re)
        finally:
            self.exitRule()
        return localctx


    class H1_sectionContext(ParserRuleContext):
        __slots__ = 'parser'

        def __init__(self, parser, parent:ParserRuleContext=None, invokingState:int=-1):
            super().__init__(parent, invokingState)
            self.parser = parser

        def h1_header(self):
            return self.getTypedRuleContext(ZorgFileParser.H1_headerContext,0)


        def NL(self, i:int=None):
            if i is None:
                return self.getTokens(ZorgFileParser.NL)
            else:
                return self.getToken(ZorgFileParser.NL, i)

        def block(self, i:int=None):
            if i is None:
                return self.getTypedRuleContexts(ZorgFileParser.BlockContext)
            else:
                return self.getTypedRuleContext(ZorgFileParser.BlockContext,i)


        def h2_section(self, i:int=None):
            if i is None:
                return self.getTypedRuleContexts(ZorgFileParser.H2_sectionContext)
            else:
                return self.getTypedRuleContext(ZorgFileParser.H2_sectionContext,i)


        def getRuleIndex(self):
            return ZorgFileParser.RULE_h1_section

        def enterRule(self, listener:ParseTreeListener):
            if hasattr( listener, "enterH1_section" ):
                listener.enterH1_section(self)

        def exitRule(self, listener:ParseTreeListener):
            if hasattr( listener, "exitH1_section" ):
                listener.exitH1_section(self)




    def h1_section(self):

        localctx = ZorgFileParser.H1_sectionContext(self, self._ctx, self.state)
        self.enterRule(localctx, 76, self.RULE_h1_section)
        self._la = 0 # Token type
        try:
            self.enterOuterAlt(localctx, 1)
            self.state = 362
            self.h1_header()
            self.state = 366
            self._errHandler.sync(self)
            _alt = self._interp.adaptivePredict(self._input,38,self._ctx)
            while _alt!=2 and _alt!=ATN.INVALID_ALT_NUMBER:
                if _alt==1:
                    self.state = 363
                    self.match(ZorgFileParser.NL) 
                self.state = 368
                self._errHandler.sync(self)
                _alt = self._interp.adaptivePredict(self._input,38,self._ctx)

            self.state = 372
            self._errHandler.sync(self)
            _alt = self._interp.adaptivePredict(self._input,39,self._ctx)
            while _alt!=2 and _alt!=ATN.INVALID_ALT_NUMBER:
                if _alt==1:
                    self.state = 369
                    self.block() 
                self.state = 374
                self._errHandler.sync(self)
                _alt = self._interp.adaptivePredict(self._input,39,self._ctx)

            self.state = 381
            self._errHandler.sync(self)
            _la = self._input.LA(1)
            while _la==5 or _la==7:
                self.state = 376
                self._errHandler.sync(self)
                _la = self._input.LA(1)
                if _la==7:
                    self.state = 375
                    self.match(ZorgFileParser.NL)


                self.state = 378
                self.h2_section()
                self.state = 383
                self._errHandler.sync(self)
                _la = self._input.LA(1)

        except RecognitionException as re:
            localctx.exception = re
            self._errHandler.reportError(self, re)
            self._errHandler.recover(self, re)
        finally:
            self.exitRule()
        return localctx


    class H2_sectionContext(ParserRuleContext):
        __slots__ = 'parser'

        def __init__(self, parser, parent:ParserRuleContext=None, invokingState:int=-1):
            super().__init__(parent, invokingState)
            self.parser = parser

        def h2_header(self):
            return self.getTypedRuleContext(ZorgFileParser.H2_headerContext,0)


        def NL(self, i:int=None):
            if i is None:
                return self.getTokens(ZorgFileParser.NL)
            else:
                return self.getToken(ZorgFileParser.NL, i)

        def block(self, i:int=None):
            if i is None:
                return self.getTypedRuleContexts(ZorgFileParser.BlockContext)
            else:
                return self.getTypedRuleContext(ZorgFileParser.BlockContext,i)


        def h3_section(self, i:int=None):
            if i is None:
                return self.getTypedRuleContexts(ZorgFileParser.H3_sectionContext)
            else:
                return self.getTypedRuleContext(ZorgFileParser.H3_sectionContext,i)


        def getRuleIndex(self):
            return ZorgFileParser.RULE_h2_section

        def enterRule(self, listener:ParseTreeListener):
            if hasattr( listener, "enterH2_section" ):
                listener.enterH2_section(self)

        def exitRule(self, listener:ParseTreeListener):
            if hasattr( listener, "exitH2_section" ):
                listener.exitH2_section(self)




    def h2_section(self):

        localctx = ZorgFileParser.H2_sectionContext(self, self._ctx, self.state)
        self.enterRule(localctx, 78, self.RULE_h2_section)
        self._la = 0 # Token type
        try:
            self.enterOuterAlt(localctx, 1)
            self.state = 384
            self.h2_header()
            self.state = 388
            self._errHandler.sync(self)
            _alt = self._interp.adaptivePredict(self._input,42,self._ctx)
            while _alt!=2 and _alt!=ATN.INVALID_ALT_NUMBER:
                if _alt==1:
                    self.state = 385
                    self.match(ZorgFileParser.NL) 
                self.state = 390
                self._errHandler.sync(self)
                _alt = self._interp.adaptivePredict(self._input,42,self._ctx)

            self.state = 394
            self._errHandler.sync(self)
            _alt = self._interp.adaptivePredict(self._input,43,self._ctx)
            while _alt!=2 and _alt!=ATN.INVALID_ALT_NUMBER:
                if _alt==1:
                    self.state = 391
                    self.block() 
                self.state = 396
                self._errHandler.sync(self)
                _alt = self._interp.adaptivePredict(self._input,43,self._ctx)

            self.state = 403
            self._errHandler.sync(self)
            _alt = self._interp.adaptivePredict(self._input,45,self._ctx)
            while _alt!=2 and _alt!=ATN.INVALID_ALT_NUMBER:
                if _alt==1:
                    self.state = 398
                    self._errHandler.sync(self)
                    _la = self._input.LA(1)
                    if _la==7:
                        self.state = 397
                        self.match(ZorgFileParser.NL)


                    self.state = 400
                    self.h3_section() 
                self.state = 405
                self._errHandler.sync(self)
                _alt = self._interp.adaptivePredict(self._input,45,self._ctx)

        except RecognitionException as re:
            localctx.exception = re
            self._errHandler.reportError(self, re)
            self._errHandler.recover(self, re)
        finally:
            self.exitRule()
        return localctx


    class H3_sectionContext(ParserRuleContext):
        __slots__ = 'parser'

        def __init__(self, parser, parent:ParserRuleContext=None, invokingState:int=-1):
            super().__init__(parent, invokingState)
            self.parser = parser

        def h3_header(self):
            return self.getTypedRuleContext(ZorgFileParser.H3_headerContext,0)


        def NL(self, i:int=None):
            if i is None:
                return self.getTokens(ZorgFileParser.NL)
            else:
                return self.getToken(ZorgFileParser.NL, i)

        def block(self, i:int=None):
            if i is None:
                return self.getTypedRuleContexts(ZorgFileParser.BlockContext)
            else:
                return self.getTypedRuleContext(ZorgFileParser.BlockContext,i)


        def h4_section(self, i:int=None):
            if i is None:
                return self.getTypedRuleContexts(ZorgFileParser.H4_sectionContext)
            else:
                return self.getTypedRuleContext(ZorgFileParser.H4_sectionContext,i)


        def getRuleIndex(self):
            return ZorgFileParser.RULE_h3_section

        def enterRule(self, listener:ParseTreeListener):
            if hasattr( listener, "enterH3_section" ):
                listener.enterH3_section(self)

        def exitRule(self, listener:ParseTreeListener):
            if hasattr( listener, "exitH3_section" ):
                listener.exitH3_section(self)




    def h3_section(self):

        localctx = ZorgFileParser.H3_sectionContext(self, self._ctx, self.state)
        self.enterRule(localctx, 80, self.RULE_h3_section)
        self._la = 0 # Token type
        try:
            self.enterOuterAlt(localctx, 1)
            self.state = 406
            self.h3_header()
            self.state = 410
            self._errHandler.sync(self)
            _alt = self._interp.adaptivePredict(self._input,46,self._ctx)
            while _alt!=2 and _alt!=ATN.INVALID_ALT_NUMBER:
                if _alt==1:
                    self.state = 407
                    self.match(ZorgFileParser.NL) 
                self.state = 412
                self._errHandler.sync(self)
                _alt = self._interp.adaptivePredict(self._input,46,self._ctx)

            self.state = 416
            self._errHandler.sync(self)
            _alt = self._interp.adaptivePredict(self._input,47,self._ctx)
            while _alt!=2 and _alt!=ATN.INVALID_ALT_NUMBER:
                if _alt==1:
                    self.state = 413
                    self.block() 
                self.state = 418
                self._errHandler.sync(self)
                _alt = self._interp.adaptivePredict(self._input,47,self._ctx)

            self.state = 425
            self._errHandler.sync(self)
            _alt = self._interp.adaptivePredict(self._input,49,self._ctx)
            while _alt!=2 and _alt!=ATN.INVALID_ALT_NUMBER:
                if _alt==1:
                    self.state = 420
                    self._errHandler.sync(self)
                    _la = self._input.LA(1)
                    if _la==7:
                        self.state = 419
                        self.match(ZorgFileParser.NL)


                    self.state = 422
                    self.h4_section() 
                self.state = 427
                self._errHandler.sync(self)
                _alt = self._interp.adaptivePredict(self._input,49,self._ctx)

        except RecognitionException as re:
            localctx.exception = re
            self._errHandler.reportError(self, re)
            self._errHandler.recover(self, re)
        finally:
            self.exitRule()
        return localctx


    class H4_sectionContext(ParserRuleContext):
        __slots__ = 'parser'

        def __init__(self, parser, parent:ParserRuleContext=None, invokingState:int=-1):
            super().__init__(parent, invokingState)
            self.parser = parser

        def h4_header(self):
            return self.getTypedRuleContext(ZorgFileParser.H4_headerContext,0)


        def NL(self, i:int=None):
            if i is None:
                return self.getTokens(ZorgFileParser.NL)
            else:
                return self.getToken(ZorgFileParser.NL, i)

        def block(self, i:int=None):
            if i is None:
                return self.getTypedRuleContexts(ZorgFileParser.BlockContext)
            else:
                return self.getTypedRuleContext(ZorgFileParser.BlockContext,i)


        def getRuleIndex(self):
            return ZorgFileParser.RULE_h4_section

        def enterRule(self, listener:ParseTreeListener):
            if hasattr( listener, "enterH4_section" ):
                listener.enterH4_section(self)

        def exitRule(self, listener:ParseTreeListener):
            if hasattr( listener, "exitH4_section" ):
                listener.exitH4_section(self)




    def h4_section(self):

        localctx = ZorgFileParser.H4_sectionContext(self, self._ctx, self.state)
        self.enterRule(localctx, 82, self.RULE_h4_section)
        try:
            self.enterOuterAlt(localctx, 1)
            self.state = 428
            self.h4_header()
            self.state = 432
            self._errHandler.sync(self)
            _alt = self._interp.adaptivePredict(self._input,50,self._ctx)
            while _alt!=2 and _alt!=ATN.INVALID_ALT_NUMBER:
                if _alt==1:
                    self.state = 429
                    self.match(ZorgFileParser.NL) 
                self.state = 434
                self._errHandler.sync(self)
                _alt = self._interp.adaptivePredict(self._input,50,self._ctx)

            self.state = 438
            self._errHandler.sync(self)
            _alt = self._interp.adaptivePredict(self._input,51,self._ctx)
            while _alt!=2 and _alt!=ATN.INVALID_ALT_NUMBER:
                if _alt==1:
                    self.state = 435
                    self.block() 
                self.state = 440
                self._errHandler.sync(self)
                _alt = self._interp.adaptivePredict(self._input,51,self._ctx)

        except RecognitionException as re:
            localctx.exception = re
            self._errHandler.reportError(self, re)
            self._errHandler.recover(self, re)
        finally:
            self.exitRule()
        return localctx


    class H1_headerContext(ParserRuleContext):
        __slots__ = 'parser'

        def __init__(self, parser, parent:ParserRuleContext=None, invokingState:int=-1):
            super().__init__(parent, invokingState)
            self.parser = parser

        def HASH(self, i:int=None):
            if i is None:
                return self.getTokens(ZorgFileParser.HASH)
            else:
                return self.getToken(ZorgFileParser.HASH, i)

        def space_atoms(self):
            return self.getTypedRuleContext(ZorgFileParser.Space_atomsContext,0)


        def eol(self):
            return self.getTypedRuleContext(ZorgFileParser.EolContext,0)


        def getRuleIndex(self):
            return ZorgFileParser.RULE_h1_header

        def enterRule(self, listener:ParseTreeListener):
            if hasattr( listener, "enterH1_header" ):
                listener.enterH1_header(self)

        def exitRule(self, listener:ParseTreeListener):
            if hasattr( listener, "exitH1_header" ):
                listener.exitH1_header(self)




    def h1_header(self):

        localctx = ZorgFileParser.H1_headerContext(self, self._ctx, self.state)
        self.enterRule(localctx, 84, self.RULE_h1_header)
        try:
            self.enterOuterAlt(localctx, 1)
            self.state = 441
            self.match(ZorgFileParser.HASH)
            self.state = 442
            self.match(ZorgFileParser.HASH)
            self.state = 443
            self.match(ZorgFileParser.HASH)
            self.state = 444
            self.match(ZorgFileParser.HASH)
            self.state = 445
            self.match(ZorgFileParser.HASH)
            self.state = 446
            self.match(ZorgFileParser.HASH)
            self.state = 447
            self.match(ZorgFileParser.HASH)
            self.state = 448
            self.match(ZorgFileParser.HASH)
            self.state = 449
            self.match(ZorgFileParser.HASH)
            self.state = 450
            self.space_atoms()
            self.state = 451
            self.eol()
        except RecognitionException as re:
            localctx.exception = re
            self._errHandler.reportError(self, re)
            self._errHandler.recover(self, re)
        finally:
            self.exitRule()
        return localctx


    class H2_headerContext(ParserRuleContext):
        __slots__ = 'parser'

        def __init__(self, parser, parent:ParserRuleContext=None, invokingState:int=-1):
            super().__init__(parent, invokingState)
            self.parser = parser

        def space_atoms(self):
            return self.getTypedRuleContext(ZorgFileParser.Space_atomsContext,0)


        def eol(self):
            return self.getTypedRuleContext(ZorgFileParser.EolContext,0)


        def getRuleIndex(self):
            return ZorgFileParser.RULE_h2_header

        def enterRule(self, listener:ParseTreeListener):
            if hasattr( listener, "enterH2_header" ):
                listener.enterH2_header(self)

        def exitRule(self, listener:ParseTreeListener):
            if hasattr( listener, "exitH2_header" ):
                listener.exitH2_header(self)




    def h2_header(self):

        localctx = ZorgFileParser.H2_headerContext(self, self._ctx, self.state)
        self.enterRule(localctx, 86, self.RULE_h2_header)
        try:
            self.enterOuterAlt(localctx, 1)
            self.state = 453
            self.match(ZorgFileParser.T__4)
            self.state = 454
            self.space_atoms()
            self.state = 455
            self.eol()
        except RecognitionException as re:
            localctx.exception = re
            self._errHandler.reportError(self, re)
            self._errHandler.recover(self, re)
        finally:
            self.exitRule()
        return localctx


    class H3_headerContext(ParserRuleContext):
        __slots__ = 'parser'

        def __init__(self, parser, parent:ParserRuleContext=None, invokingState:int=-1):
            super().__init__(parent, invokingState)
            self.parser = parser

        def space_atoms(self):
            return self.getTypedRuleContext(ZorgFileParser.Space_atomsContext,0)


        def eol(self):
            return self.getTypedRuleContext(ZorgFileParser.EolContext,0)


        def getRuleIndex(self):
            return ZorgFileParser.RULE_h3_header

        def enterRule(self, listener:ParseTreeListener):
            if hasattr( listener, "enterH3_header" ):
                listener.enterH3_header(self)

        def exitRule(self, listener:ParseTreeListener):
            if hasattr( listener, "exitH3_header" ):
                listener.exitH3_header(self)




    def h3_header(self):

        localctx = ZorgFileParser.H3_headerContext(self, self._ctx, self.state)
        self.enterRule(localctx, 88, self.RULE_h3_header)
        try:
            self.enterOuterAlt(localctx, 1)
            self.state = 457
            self.match(ZorgFileParser.T__5)
            self.state = 458
            self.space_atoms()
            self.state = 459
            self.eol()
        except RecognitionException as re:
            localctx.exception = re
            self._errHandler.reportError(self, re)
            self._errHandler.recover(self, re)
        finally:
            self.exitRule()
        return localctx


    class H4_headerContext(ParserRuleContext):
        __slots__ = 'parser'

        def __init__(self, parser, parent:ParserRuleContext=None, invokingState:int=-1):
            super().__init__(parent, invokingState)
            self.parser = parser

        def DASH(self, i:int=None):
            if i is None:
                return self.getTokens(ZorgFileParser.DASH)
            else:
                return self.getToken(ZorgFileParser.DASH, i)

        def space_atoms(self):
            return self.getTypedRuleContext(ZorgFileParser.Space_atomsContext,0)


        def eol(self):
            return self.getTypedRuleContext(ZorgFileParser.EolContext,0)


        def getRuleIndex(self):
            return ZorgFileParser.RULE_h4_header

        def enterRule(self, listener:ParseTreeListener):
            if hasattr( listener, "enterH4_header" ):
                listener.enterH4_header(self)

        def exitRule(self, listener:ParseTreeListener):
            if hasattr( listener, "exitH4_header" ):
                listener.exitH4_header(self)




    def h4_header(self):

        localctx = ZorgFileParser.H4_headerContext(self, self._ctx, self.state)
        self.enterRule(localctx, 90, self.RULE_h4_header)
        try:
            self.enterOuterAlt(localctx, 1)
            self.state = 461
            self.match(ZorgFileParser.DASH)
            self.state = 462
            self.match(ZorgFileParser.DASH)
            self.state = 463
            self.match(ZorgFileParser.DASH)
            self.state = 464
            self.space_atoms()
            self.state = 465
            self.eol()
        except RecognitionException as re:
            localctx.exception = re
            self._errHandler.reportError(self, re)
            self._errHandler.recover(self, re)
        finally:
            self.exitRule()
        return localctx


    class EolContext(ParserRuleContext):
        __slots__ = 'parser'

        def __init__(self, parser, parent:ParserRuleContext=None, invokingState:int=-1):
            super().__init__(parent, invokingState)
            self.parser = parser

        def NL(self):
            return self.getToken(ZorgFileParser.NL, 0)

        def EOF(self):
            return self.getToken(ZorgFileParser.EOF, 0)

        def getRuleIndex(self):
            return ZorgFileParser.RULE_eol

        def enterRule(self, listener:ParseTreeListener):
            if hasattr( listener, "enterEol" ):
                listener.enterEol(self)

        def exitRule(self, listener:ParseTreeListener):
            if hasattr( listener, "exitEol" ):
                listener.exitEol(self)




    def eol(self):

        localctx = ZorgFileParser.EolContext(self, self._ctx, self.state)
        self.enterRule(localctx, 92, self.RULE_eol)
        self._la = 0 # Token type
        try:
            self.enterOuterAlt(localctx, 1)
            self.state = 467
            _la = self._input.LA(1)
            if not(_la==-1 or _la==7):
                self._errHandler.recoverInline(self)
            else:
                self._errHandler.reportMatch(self)
                self.consume()
        except RecognitionException as re:
            localctx.exception = re
            self._errHandler.reportError(self, re)
            self._errHandler.recover(self, re)
        finally:
            self.exitRule()
        return localctx





