private LockupValue ParceInternal(string text)
        {
            var textStream   = new AntlrInputStream(text.ToLower());
            var lexer        = new EurekahedgeLockupAntlrLexer(textStream);
            var tockenStream = new CommonTokenStream(lexer);
            var parcer       = new EurekahedgeLockupAntlrParser(tockenStream);

            var visitor = new EurekahedgeLockupAntlrVisitor();

            visitor.VisitGeneral(parcer.general());

            LockupValue result = new LockupValue();

            // Duration
            if (visitor.periodMatch != null)
            {
                result.LockupDuration = ToDuration(visitor.numberMatch, visitor.periodMatch);
            }

            // Period
            if (visitor.periodMatch != null)
            {
                result.LockupPeriod = ToPeriod(visitor.periodMatch.TokenType);
            }

            // Fee
            if (visitor.percentMatch != null && visitor.periodMatch != null)
            {
                result.LockupFee = ToFee(visitor.percentMatch);
            }

            // LockupType
            if (visitor.softOrHardMatch != null)
            {
                result.LockupType = visitor.softOrHardMatch.TokenType == EurekahedgeLockupTokenType.Soft ? LockupType.Soft : LockupType.Hard;
            }
            else if (visitor.yesOrNoMatch?.TokenType == EurekahedgeLockupTokenType.No && visitor.periodMatch != null)
            {
                result.LockupType = LockupType.Soft;
            }
            else if (visitor.percentMatch != null && result.LockupFee != null && visitor.periodMatch != null)
            {
                result.LockupType = LockupType.Soft;
            }
            else if (visitor.yesOrNoMatch?.TokenType == EurekahedgeLockupTokenType.Yes)
            {
                result.LockupType = LockupType.Hard;
            }
            else if (visitor.periodMatch != null)
            {
                result.LockupType = LockupType.Hard;
            }

            return(result);
        }
        private LockupValue Parce(List <EurekahedgeLockupTockenizer.TokenMatch> tokens)
        {
            LockupValue result = new LockupValue();

            // Duration, Period
            Tockenizer <EurekahedgeLockupTokenType> .TokenMatch numberMatch;
            Tockenizer <EurekahedgeLockupTokenType> .TokenMatch periodMatch;
            FindNumberPeriodPattern(tokens, out numberMatch, out periodMatch);
            if (numberMatch != null)
            {
                result.LockupDuration = ToDuration(numberMatch, periodMatch);
            }
            if (periodMatch != null)
            {
                result.LockupPeriod = ToPeriod(periodMatch.TokenType);
            }

            // Fee
            Tockenizer <EurekahedgeLockupTokenType> .TokenMatch percentMatch = tokens.FirstOrDefault(x => x.TokenType == EurekahedgeLockupTokenType.PercentValue);
            if (percentMatch != null)
            {
                result.LockupFee = ToFee(percentMatch);
            }

            // LockupType
            Tockenizer <EurekahedgeLockupTokenType> .TokenMatch softOrHardMatch = tokens.FirstOrDefault(x => IsSoftOrHard(x.TokenType));
            if (softOrHardMatch != null)
            {
                result.LockupType = softOrHardMatch.TokenType == EurekahedgeLockupTokenType.Hard ? LockupType.Hard : LockupType.Soft;
            }
            else if (percentMatch != null)
            {
                result.LockupType = LockupType.Soft;
            }
            else if (periodMatch != null)
            {
                result.LockupType = tokens.Any(x => x.TokenType == EurekahedgeLockupTokenType.No) ? LockupType.Soft : LockupType.Hard;
            }
            else if (tokens.Any(x => x.TokenType == EurekahedgeLockupTokenType.Yes))
            {
                result.LockupType = LockupType.Hard;
            }

            if (!result.LockupFee.HasValue && (!result.LockupDuration.HasValue || !result.LockupPeriod.HasValue))
            {
                if (tokens.Exists(x => IsPeriodType(x.TokenType)) || tokens.Exists(x => IsNumberType(x.TokenType)))
                {
                    result.Warning = true;
                }
            }

            return(result);
        }