linux-packaging-mono/mcs/ilasm/parser/ScannerAdapter.cs
Jo Shields a575963da9 Imported Upstream version 3.6.0
Former-commit-id: da6be194a6b1221998fc28233f2503bd61dd9d14
2014-08-13 10:39:27 +01:00

61 lines
980 B
C#

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