-
Notifications
You must be signed in to change notification settings - Fork 1
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Postpone problem with ambiguity of actual parameters to semantic anal…
…ysis
- Loading branch information
linkrope
committed
Aug 14, 2024
1 parent
2412e11
commit eb678d0
Showing
15 changed files
with
278 additions
and
289 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,41 @@ | ||
module gamma.grammar.hyper.ActualParams; | ||
|
||
import gamma.grammar.hyper.HyperVisitor; | ||
import gamma.grammar.hyper.Operator; | ||
import gamma.grammar.hyper.Params; | ||
import gamma.grammar.Node; | ||
import gamma.grammar.Visitor; | ||
import gamma.util.Position; | ||
|
||
/** | ||
* This value object represents actual parameters on the right-hand side of a hyper rule. | ||
* | ||
* Note that for ident [ ActualParams ] [ ActualParams ] '(' (or '[' or '{') | ||
* it is not obvious whether single ActualParams belong to ident or to '('. | ||
* To keep the parser simple, this problem is postponed to semantic analysis. | ||
*/ | ||
public class ActualParams : Node | ||
{ | ||
private Params params_; | ||
|
||
public this(Params params) | ||
{ | ||
super(params.position); | ||
this.params_ = params; | ||
} | ||
|
||
public override void accept(Visitor visitor) | ||
{ | ||
accept(cast(HyperVisitor) visitor); | ||
} | ||
|
||
public void accept(HyperVisitor visitor) | ||
{ | ||
visitor.visit(this); | ||
} | ||
|
||
public Params params() | ||
{ | ||
return this.params_; | ||
} | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
21 changes: 14 additions & 7 deletions
21
...mma/grammar/hyper/RepetitionAlternative.d → src/gamma/grammar/hyper/HyperAlternative.d
100755 → 100644
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file was deleted.
Oops, something went wrong.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,18 +1,21 @@ | ||
module gamma.grammar.hyper.HyperVisitor; | ||
|
||
import gamma.grammar.hyper.ActualParams; | ||
import gamma.grammar.hyper.Group; | ||
import gamma.grammar.hyper.HyperAlternative; | ||
import gamma.grammar.hyper.Option; | ||
import gamma.grammar.hyper.Repetition; | ||
import gamma.grammar.hyper.RepetitionAlternative; | ||
import gamma.grammar.Visitor; | ||
|
||
public interface HyperVisitor : Visitor | ||
{ | ||
public void visit(HyperAlternative); | ||
|
||
public void visit(ActualParams); | ||
|
||
public void visit(Group); | ||
|
||
public void visit(Option); | ||
|
||
public void visit(Repetition); | ||
|
||
public void visit(RepetitionAlternative); | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Oops, something went wrong.