progress
This commit is contained in:
parent
16e76d6b31
commit
484dbfc9d9
529 changed files with 113694 additions and 0 deletions
65
AspClassic.Scripting/Hosting/TokenCategorizer.cs
Normal file
65
AspClassic.Scripting/Hosting/TokenCategorizer.cs
Normal file
|
@ -0,0 +1,65 @@
|
|||
using System;
|
||||
using System.Collections.Generic;
|
||||
using System.Security.Permissions;
|
||||
using AspClassic.Scripting.Runtime;
|
||||
|
||||
namespace AspClassic.Scripting.Hosting;
|
||||
|
||||
public sealed class TokenCategorizer : MarshalByRefObject
|
||||
{
|
||||
private readonly TokenizerService _tokenizer;
|
||||
|
||||
public object CurrentState => _tokenizer.CurrentState;
|
||||
|
||||
public SourceLocation CurrentPosition => _tokenizer.CurrentPosition;
|
||||
|
||||
public bool IsRestartable => _tokenizer.IsRestartable;
|
||||
|
||||
public ErrorSink ErrorSink
|
||||
{
|
||||
get
|
||||
{
|
||||
return _tokenizer.ErrorSink;
|
||||
}
|
||||
set
|
||||
{
|
||||
_tokenizer.ErrorSink = value;
|
||||
}
|
||||
}
|
||||
|
||||
internal TokenCategorizer(TokenizerService tokenizer)
|
||||
{
|
||||
_tokenizer = tokenizer;
|
||||
}
|
||||
|
||||
public void Initialize(object state, ScriptSource scriptSource, SourceLocation initialLocation)
|
||||
{
|
||||
_tokenizer.Initialize(state, scriptSource.SourceUnit.GetReader(), scriptSource.SourceUnit, initialLocation);
|
||||
}
|
||||
|
||||
public TokenInfo ReadToken()
|
||||
{
|
||||
return _tokenizer.ReadToken();
|
||||
}
|
||||
|
||||
public bool SkipToken()
|
||||
{
|
||||
return _tokenizer.SkipToken();
|
||||
}
|
||||
|
||||
public IEnumerable<TokenInfo> ReadTokens(int characterCount)
|
||||
{
|
||||
return _tokenizer.ReadTokens(characterCount);
|
||||
}
|
||||
|
||||
public bool SkipTokens(int characterCount)
|
||||
{
|
||||
return _tokenizer.SkipTokens(characterCount);
|
||||
}
|
||||
|
||||
[SecurityPermission(SecurityAction.LinkDemand, Flags = SecurityPermissionFlag.Infrastructure)]
|
||||
public override object InitializeLifetimeService()
|
||||
{
|
||||
return null;
|
||||
}
|
||||
}
|
Loading…
Add table
Add a link
Reference in a new issue