LexicalAnalyzer 1.0.1
dotnet add package LexicalAnalyzer --version 1.0.1
NuGet\Install-Package LexicalAnalyzer -Version 1.0.1
<PackageReference Include="LexicalAnalyzer" Version="1.0.1" />
paket add LexicalAnalyzer --version 1.0.1
#r "nuget: LexicalAnalyzer, 1.0.1"
// Install LexicalAnalyzer as a Cake Addin #addin nuget:?package=LexicalAnalyzer&version=1.0.1 // Install LexicalAnalyzer as a Cake Tool #tool nuget:?package=LexicalAnalyzer&version=1.0.1
LexicalAnalyzer Analisador Léxico para uma linguagem hipotética. A partir de uma entrada, onde contem uma cadeia de caracteres, é gerado uma lista de lexemas+tokens. Exemplo: "var resultado = (34 / (3 + 5)", gera os seguintes lexemas+tokens.
'var' → RESERVED_WORD_VAR 'resultado' → IDENTIFIER '=' → ASSIGNMENT '34' → NUMBER '/' → OPERATOR_DIVISION '(' → DELIMITER_OPEN_PARENTHESES '3' → NUMBER '+' → OPERATOR_SUM '5' → NUMBER ')' → DELIMITER_CLOSE_PARENTHESES Como usar Disponível em: Nuget Install into your PCL project and Client projects.
static void Main(string[] args)
{
string codigo = "var teste = (34 / (3.5 + 5^2) ." +
"if (34 >= 5) { return; }";
Lexer lexer = new Lexer();
IEnumerable<TokenDefinition> tokenDefinition = TokenDefinition.GetTokens();
foreach (var token in tokenDefinition)
{
lexer.AddDefinition(token);
}
var tokens = lexer.Tokenize(codigo).ToList();
foreach (var item in tokens)
{
Console.WriteLine(item.ToString());
}
Console.Read();
}
O Analisador Léxico foi feito baseado em definições regulares que analisam os padrões do código de entrada e Autômatos Finitos que aceitam as definições regulares.
Tecnologias implementadas: .NET Core 2.0
Sobre: Desenvolvido por Mauricio Moccelin sobre Licença GNU.
Product | Versions Compatible and additional computed target framework versions. |
---|---|
.NET | net5.0 was computed. net5.0-windows was computed. net6.0 was computed. net6.0-android was computed. net6.0-ios was computed. net6.0-maccatalyst was computed. net6.0-macos was computed. net6.0-tvos was computed. net6.0-windows was computed. net7.0 was computed. net7.0-android was computed. net7.0-ios was computed. net7.0-maccatalyst was computed. net7.0-macos was computed. net7.0-tvos was computed. net7.0-windows was computed. net8.0 was computed. net8.0-android was computed. net8.0-browser was computed. net8.0-ios was computed. net8.0-maccatalyst was computed. net8.0-macos was computed. net8.0-tvos was computed. net8.0-windows was computed. |
.NET Core | netcoreapp2.0 is compatible. netcoreapp2.1 was computed. netcoreapp2.2 was computed. netcoreapp3.0 was computed. netcoreapp3.1 was computed. |
-
.NETCoreApp 2.0
- No dependencies.
NuGet packages
This package is not used by any NuGet packages.
GitHub repositories
This package is not used by any popular GitHub repositories.
Reconhece valores decimais e inteiros.