-
Notifications
You must be signed in to change notification settings - Fork 0
/
Sintaxis.cs
43 lines (42 loc) · 1.13 KB
/
Sintaxis.cs
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
using System;
using System.Collections.Generic;
using System.Linq;
using System.Threading.Tasks;
namespace Sintaxis_2
{
public class Sintaxis : Lexico
{
public Sintaxis()
{
nextToken();
}
public Sintaxis(string nombre) : base(nombre)
{
nextToken();
}
public void match(string token_esperado)
{
//Console.WriteLine(getContenido() + " " + getClasificacion());
if (token_esperado == getContenido())
{
nextToken();
}
else
{
throw new Error("de sintaxis, se espera un <" + token_esperado + ">", log, linea, columna);
}
}
public void match(Tipos token_esperado)
{
//Console.WriteLine(getContenido() + " " + getClasificacion());
if (token_esperado == getClasificacion())
{
nextToken();
}
else
{
throw new Error("de sintaxis, se espera un <" + token_esperado + ">", log, linea, columna);
}
}
}
}