189
if(!int.TryParse(ltNumber.Val, out lval)) throw new Exception($"{ex.Op} {exIdLt.Id} {ltNumber.Val} is not a number");
1
using System;
2
using Sprache;
3
using System.Linq;
4
using System.Collections.Generic;
5
6
namespace dotnet_parser
7
{
8
class Program
9
{
10
/*
11
ex := op '(' pr ')' //expression
12
pr := id ',' lt | ex (',' ex)* //parameter (* means zero or more)
13
op := string //operator
14
id := string //id
15
lt := quoted-string | number //literal
16
*/
17
18
static void Main(string[] args)
19
{
20
var ex = Parser.getEx().Parse(@"
21
OR(
22
AND(
23
EQUAL(title, ""Foo""),
24
AND(
Cached Result