Compartilhar via


StreamTokenizer Class

Definition

The StreamTokenizer class takes an input stream and parses it into "tokens", allowing the tokens to be read one at a time.

[Android.Runtime.Register("java/io/StreamTokenizer", DoNotGenerateAcw=true)]
public class StreamTokenizer : Java.Lang.Object
[<Android.Runtime.Register("java/io/StreamTokenizer", DoNotGenerateAcw=true)>]
type StreamTokenizer = class
    inherit Object
Inheritance
StreamTokenizer
Attributes

Remarks

The StreamTokenizer class takes an input stream and parses it into "tokens", allowing the tokens to be read one at a time. The parsing process is controlled by a table and a number of flags that can be set to various states. The stream tokenizer can recognize identifiers, numbers, quoted strings, and various comment styles.

Each byte read from the input stream is regarded as a character in the range '\u005Cu0000' through '\u005Cu00FF'. The character value is used to look up five possible attributes of the character: white space, alphabetic, numeric, string quote, and comment character. Each character can have zero or more of these attributes.

In addition, an instance has four flags. These flags indicate: <ul> <li>Whether line terminators are to be returned as tokens or treated as white space that merely separates tokens. <li>Whether C-style comments are to be recognized and skipped. <li>Whether C++-style comments are to be recognized and skipped. <li>Whether the characters of identifiers are converted to lowercase. </ul>

A typical application first constructs an instance of this class, sets up the syntax tables, and then repeatedly loops calling the nextToken method in each iteration of the loop until it returns the value TT_EOF.

Added in 1.0.

Java documentation for java.io.StreamTokenizer.

Portions of this page are modifications based on work created and shared by the Android Open Source Project and used according to terms described in the Creative Commons 2.5 Attribution License.

Constructors

StreamTokenizer(IntPtr, JniHandleOwnership)

A constructor used when creating managed representations of JNI objects; called by the runtime.

StreamTokenizer(Reader)

Create a tokenizer that parses the given character stream.

StreamTokenizer(Stream)
Obsolete.

Creates a stream tokenizer that parses the specified input stream.

Fields

TtEof
Obsolete.

A constant indicating that the end of the stream has been read.

TtEol
Obsolete.

A constant indicating that the end of the line has been read.

TtNumber
Obsolete.

A constant indicating that a number token has been read.

TtWord
Obsolete.

A constant indicating that a word token has been read.

Properties

Class

Returns the runtime class of this Object.

(Inherited from Object)
Handle

The handle to the underlying Android instance.

(Inherited from Object)
JniIdentityHashCode (Inherited from Object)
JniPeerMembers
Nval

If the current token is a number, this field contains the value of that number.

PeerReference (Inherited from Object)
Sval

If the current token is a word token, this field contains a string giving the characters of the word token.

ThresholdClass

This API supports the Mono for Android infrastructure and is not intended to be used directly from your code.

ThresholdType

This API supports the Mono for Android infrastructure and is not intended to be used directly from your code.

Ttype

After a call to the nextToken method, this field contains the type of the token just read.

Methods

Clone()

Creates and returns a copy of this object.

(Inherited from Object)
CommentChar(Int32)

Specified that the character argument starts a single-line comment.

Dispose() (Inherited from Object)
Dispose(Boolean) (Inherited from Object)
EolIsSignificant(Boolean)

Determines whether or not ends of line are treated as tokens.

Equals(Object)

Indicates whether some other object is "equal to" this one.

(Inherited from Object)
GetHashCode()

Returns a hash code value for the object.

(Inherited from Object)
JavaFinalize()

Called by the garbage collector on an object when garbage collection determines that there are no more references to the object.

(Inherited from Object)
Lineno()

Return the current line number.

LowerCaseMode(Boolean)

Determines whether or not word token are automatically lowercased.

NextToken()

Parses the next token from the input stream of this tokenizer.

Notify()

Wakes up a single thread that is waiting on this object's monitor.

(Inherited from Object)
NotifyAll()

Wakes up all threads that are waiting on this object's monitor.

(Inherited from Object)
OrdinaryChar(Int32)

Specifies that the character argument is "ordinary" in this tokenizer.

OrdinaryChars(Int32, Int32)

Specifies that all characters c in the range low&nbsp;&lt;=&nbsp;<i>c</i>&nbsp;&lt;=&nbsp;high are "ordinary" in this tokenizer.

ParseNumbers()

Specifies that numbers should be parsed by this tokenizer.

PushBack()

Causes the next call to the nextToken method of this tokenizer to return the current value in the ttype field, and not to modify the value in the nval or sval field.

QuoteChar(Int32)

Specifies that matching pairs of this character delimit string constants in this tokenizer.

ResetSyntax()

Resets this tokenizer's syntax table so that all characters are "ordinary.

SetHandle(IntPtr, JniHandleOwnership)

Sets the Handle property.

(Inherited from Object)
SlashSlashComments(Boolean)

Determines whether or not the tokenizer recognizes C++-style comments.

SlashStarComments(Boolean)

Determines whether or not the tokenizer recognizes C-style comments.

ToArray<T>() (Inherited from Object)
ToString()

Returns a string representation of the object.

(Inherited from Object)
UnregisterFromRuntime() (Inherited from Object)
Wait()

Causes the current thread to wait until it is awakened, typically by being <em>notified</em> or <em>interrupted</em>.

(Inherited from Object)
Wait(Int64, Int32)

Causes the current thread to wait until it is awakened, typically by being <em>notified</em> or <em>interrupted</em>, or until a certain amount of real time has elapsed.

(Inherited from Object)
Wait(Int64)

Causes the current thread to wait until it is awakened, typically by being <em>notified</em> or <em>interrupted</em>, or until a certain amount of real time has elapsed.

(Inherited from Object)
WhitespaceChars(Int32, Int32)

Specifies that all characters c in the range low&nbsp;&lt;=&nbsp;<i>c</i>&nbsp;&lt;=&nbsp;high are white space characters.

WordChars(Int32, Int32)

Specifies that all characters c in the range low&nbsp;&lt;=&nbsp;<i>c</i>&nbsp;&lt;=&nbsp;high are word constituents.

Explicit Interface Implementations

IJavaPeerable.Disposed() (Inherited from Object)
IJavaPeerable.DisposeUnlessReferenced() (Inherited from Object)
IJavaPeerable.Finalized() (Inherited from Object)
IJavaPeerable.JniManagedPeerState (Inherited from Object)
IJavaPeerable.SetJniIdentityHashCode(Int32) (Inherited from Object)
IJavaPeerable.SetJniManagedPeerState(JniManagedPeerStates) (Inherited from Object)
IJavaPeerable.SetPeerReference(JniObjectReference) (Inherited from Object)

Extension Methods

JavaCast<TResult>(IJavaObject)

Performs an Android runtime-checked type conversion.

JavaCast<TResult>(IJavaObject)
GetJniTypeName(IJavaPeerable)

Applies to