예제 #1
0
 private bool IsArrayType(TokenPredictor predictor)
 {
     return(predictor
            .Expect(IsNotArrayType)
            .Expect(TokenTag.OPEN_SQUARE_BRACE)
            .Result);
 }
예제 #2
0
 private bool IsIdentifierList(TokenPredictor predictor)
 {
     return(predictor
            .Expect(TokenTag.ID)
            .Skip(TokenTag.ID, TokenTag.DOT)
            .Result);
 }
예제 #3
0
        private bool IsNotArrayType(TokenPredictor predictor)
        {
            // todo: implement checking for general type names
            var snapshot = new TokenPredictor(predictor);

            if (predictor.Expect(IsPrimitiveType).Result)
            {
                return(true);
            }

            return(false);
        }
예제 #4
0
 public TokenPredictor Restore(TokenPredictor predictor)
 {
     _shift = predictor._shift;
     Result = predictor.Result;
     return(this);
 }
예제 #5
0
 public TokenPredictor(TokenPredictor predictor)
 {
     _enumerator = predictor._enumerator;
     _shift      = predictor._shift;
     Result      = true;
 }