//----------<Keep Extracting until the none - DoublePunct>---------------------------- override public Token getTok() { Token tok = new Token(); if (isdoubleChar()) { tok.Append((char)context_.src.next()); tok.Append((char)context_.src.next()); } return(tok); }
override public Token getTok() { Token tok = new Token(); tok.Append((char)context_.src.next()); while (isSingleSpecial(context_.src.peek())) { tok.Append((char)context_.src.next()); } return tok; }
//----< keep extracting until get none-alpha >------------------- override public Token getTok() { Token tok = new Token(); tok.Append((char)context_.src.next()); // first is alpha while (isLetterOrDigit(context_.src.peek())) // stop when non-alpha { tok.Append((char)context_.src.next()); } return tok; }
//----< keep extracting until get none-punctuator >-------------- override public Token getTok() { Token tok = new Token(); tok.Append((char)context_.src.next()); // first is punctuator while (isPunctuation(context_.src.peek())) // stop when non-punctuator { tok.Append((char)context_.src.next()); } return tok; }
//----< keep extracting until get none-whitespace >-------------- override public Token getTok() { Token tok = new Token(); tok.Append((char)context_.src.next()); // first is WhiteSpace while (isWhiteSpace(context_.src.peek())) // stop when non-WhiteSpace { tok.Append((char)context_.src.next()); } return tok; }
//<-------------------Keep extracting until the none single character >----------------- override public Token getTok() { Token tok = new Token(); tok.Append((char)context_.src.next()); while (issingleChar(context_.src.peek())) { tok.Append((char)context_.src.next()); } return(tok); }