Skip to content

Commit

Permalink
move BNF and EBNF parsers in their own namespace
Browse files Browse the repository at this point in the history
  • Loading branch information
b3b00 committed Jul 30, 2024
1 parent bba2730 commit edb4d01
Show file tree
Hide file tree
Showing 15 changed files with 27 additions and 21 deletions.
3 changes: 2 additions & 1 deletion src/sly/parser/generator/EBNFParserBuilder.cs
Original file line number Diff line number Diff line change
Expand Up @@ -7,7 +7,8 @@
using sly.lexer;
using sly.lexer.fsm;
using sly.parser.generator.visitor;
using sly.parser.llparser;
using sly.parser.llparser.bnf;
using sly.parser.llparser.ebnf;
using sly.parser.syntax.grammar;

namespace sly.parser.generator
Expand Down
2 changes: 1 addition & 1 deletion src/sly/parser/generator/ParserBuilder.cs
Original file line number Diff line number Diff line change
Expand Up @@ -8,7 +8,7 @@
using sly.lexer;
using sly.lexer.fsm;
using sly.parser.generator.visitor;
using sly.parser.llparser;
using sly.parser.llparser.bnf;
using sly.parser.parser;
using sly.parser.syntax.grammar;

Expand Down
3 changes: 2 additions & 1 deletion src/sly/parser/parser/Parser.cs
Original file line number Diff line number Diff line change
Expand Up @@ -6,7 +6,8 @@
using sly.lexer;
using sly.parser.generator;
using sly.parser.generator.visitor;
using sly.parser.llparser;
using sly.parser.llparser.bnf;
using sly.parser.llparser.ebnf;
using sly.parser.parser;
using sly.parser.syntax.grammar;
using sly.parser.syntax.tree;
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -2,9 +2,9 @@
using sly.parser.syntax.grammar;
using sly.parser.syntax.tree;

namespace sly.parser.llparser;
namespace sly.parser.llparser.bnf;

public partial class RecursiveDescentSyntaxParser<IN, OUT>
public partial class RecursiveDescentSyntaxParser<IN, OUT> where IN : struct
{

protected SyntaxNode<IN> ManageExpressionRules(Rule<IN> rule, SyntaxNode<IN> node)
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -2,9 +2,9 @@
using sly.lexer;
using sly.parser.syntax.grammar;

namespace sly.parser.llparser;
namespace sly.parser.llparser.bnf;

public partial class RecursiveDescentSyntaxParser<IN, OUT>
public partial class RecursiveDescentSyntaxParser<IN, OUT> where IN : struct
{
#region parsing

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -3,9 +3,9 @@
using sly.parser.syntax.grammar;
using sly.parser.syntax.tree;

namespace sly.parser.llparser;
namespace sly.parser.llparser.bnf;

public partial class RecursiveDescentSyntaxParser<IN, OUT>
public partial class RecursiveDescentSyntaxParser<IN, OUT> where IN : struct
{
#region parsing

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -5,7 +5,7 @@
using sly.parser.syntax.tree;
using System.Linq;

namespace sly.parser.llparser
namespace sly.parser.llparser.bnf
{
public partial class RecursiveDescentSyntaxParser<IN, OUT> where IN : struct
{
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -3,7 +3,7 @@
using sly.parser.generator;
using sly.parser.syntax.grammar;

namespace sly.parser.llparser
namespace sly.parser.llparser.bnf
{
public partial class RecursiveDescentSyntaxParser<IN, OUT> : ISyntaxParser<IN, OUT> where IN : struct
{
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -2,12 +2,13 @@
using System.Collections.Generic;
using System.Linq;
using sly.lexer;
using sly.parser;
using sly.parser.syntax.grammar;
using sly.parser.syntax.tree;

namespace sly.parser.llparser;
namespace sly.parser.llparser.ebnf;

public partial class EBNFRecursiveDescentSyntaxParser<IN, OUT>
public partial class EBNFRecursiveDescentSyntaxParser<IN, OUT> where IN : struct
{
#region parsing

Expand Down
Original file line number Diff line number Diff line change
@@ -1,9 +1,10 @@
using System.Collections.Generic;
using sly.lexer;
using sly.parser;
using sly.parser.syntax.grammar;
using sly.parser.syntax.tree;

namespace sly.parser.llparser;
namespace sly.parser.llparser.ebnf;

public partial class EBNFRecursiveDescentSyntaxParser<IN, OUT>
{
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -4,9 +4,9 @@
using sly.parser.syntax.grammar;
using sly.parser.syntax.tree;

namespace sly.parser.llparser;
namespace sly.parser.llparser.ebnf;

public partial class EBNFRecursiveDescentSyntaxParser<IN, OUT>
public partial class EBNFRecursiveDescentSyntaxParser<IN, OUT> where IN : struct
{
#region parsing

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -4,9 +4,9 @@
using sly.parser.syntax.grammar;
using sly.parser.syntax.tree;

namespace sly.parser.llparser;
namespace sly.parser.llparser.ebnf;

public partial class EBNFRecursiveDescentSyntaxParser<IN, OUT>
public partial class EBNFRecursiveDescentSyntaxParser<IN, OUT> where IN : struct
{
#region parsing

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -5,8 +5,9 @@
using sly.parser.generator;
using sly.parser.syntax.tree;
using sly.parser.syntax.grammar;
using sly.parser.llparser.bnf;

namespace sly.parser.llparser
namespace sly.parser.llparser.ebnf
{
public partial class EBNFRecursiveDescentSyntaxParser<IN, OUT> : RecursiveDescentSyntaxParser<IN, OUT> where IN : struct
{
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -2,8 +2,9 @@
using System.Linq;
using sly.parser.generator;
using sly.parser.syntax.grammar;
using sly.parser.llparser.bnf;

namespace sly.parser.llparser
namespace sly.parser.llparser.ebnf
{
public partial class EBNFRecursiveDescentSyntaxParser<IN, OUT> where IN : struct
{
Expand Down
2 changes: 1 addition & 1 deletion tests/ParserTests/EBNFTests.cs
Original file line number Diff line number Diff line change
Expand Up @@ -12,7 +12,7 @@
using sly.lexer;
using sly.parser;
using sly.parser.generator;
using sly.parser.llparser;
using sly.parser.llparser.ebnf;
using sly.parser.parser;
using sly.parser.syntax.grammar;
using Xunit;
Expand Down

0 comments on commit edb4d01

Please sign in to comment.