// ScannerAdapter.cs
// (C) Sergey Chaban (serge@wildwestsoftware.com)
using System;
namespace Mono.ILASM {
///
///
public class ScannerAdapter : yyParser.yyInput {
private ITokenStream tokens;
///
///
///
public ScannerAdapter (ITokenStream tokens)
{
this.tokens = tokens;
}
///
///
public ITokenStream BaseStream {
get {
return tokens;
}
}
//
// yyParser.yyInput interface
//
///
///
///
public bool advance ()
{
return (tokens.NextToken != ILToken.EOF);
}
///
///
///
public int token ()
{
return tokens.LastToken.TokenId;
}
///
///
///
public object value ()
{
return tokens.LastToken.Value;
}
}
}