Join GitHub today
GitHub is home to over 28 million developers working together to host and review code, manage projects, and build software together.
Sign upAdd a notation for static and runtime semantics attached to grammar productions. #311
Comments
This comment has been minimized.
Show comment
Hide comment
This comment has been minimized.
claudepache
Jan 22, 2016
Contributor
Issue of my proposal: we lose the editorial distinction between the uses of runtime semantics (marked with the action verbs "performing" and "evaluating") and the use of static semantics.
Operations done at runtime should probably always be prefixed by either ? or !; that will restore that distinction.
Operations done at runtime should probably always be prefixed by either |
This comment has been minimized.
Show comment
Hide comment
This comment has been minimized.
bterlson
Jan 22, 2016
Member
I would like a new syntactic convention here. But what about using method invocation syntax, namely:
PropertyName.Evaluation(), exprValueRef.GetValue(), etc?
|
I would like a new syntactic convention here. But what about using method invocation syntax, namely: PropertyName.Evaluation(), exprValueRef.GetValue(), etc? |
This comment has been minimized.
Show comment
Hide comment
This comment has been minimized.
domenic
Jan 23, 2016
Member
I think when @bterlson explained this to me last it was important that they are really abstract methods, yeah. If that could be made more explicit, I'd be quite happy.
|
I think when @bterlson explained this to me last it was important that they are really abstract methods, yeah. If that could be made more explicit, I'd be quite happy. |
This comment has been minimized.
Show comment
Hide comment
This comment has been minimized.
jmdyck
Jan 25, 2016
Collaborator
Bear in mind that the 'target' of such an invocation can't always be referenced simply by a nonterminal. E.g., consider:
1. Let _falseRef_ be the result of evaluating the second |AssignmentExpression|.
Would that become
1. Let _falseRef_ be (the second |AssignmentExpression|).Evaluation()
or
1. Let _AE2_ be the second |AssignmentExpression|.
2. Let _falseRef_ be _AE2_.Evaluation()
or (say)
1. Let _falseRef_ be |AssignmentExpression|<sub>2</sub>.Evaluation()
(Also, the exprValueRef.GetValue() example is odd, because GetValue(V) is defined as an 'ordinary' abstract operation, not a syntax-discriminated operation.)
|
Bear in mind that the 'target' of such an invocation can't always be referenced simply by a nonterminal. E.g., consider:
Would that become
or
or (say)
(Also, the exprValueRef.GetValue() example is odd, because GetValue(V) is defined as an 'ordinary' abstract operation, not a syntax-discriminated operation.) |
claudepache commentedJan 22, 2016
It concerns the phrases of the form "the result of evaluating production with argument arg", and "the result of performing Foo of production with argument arg", and variations thereof.
Possible notation (to be bikesheded):
etc.
That will allow to replace the majority of remaining ReturnIfAbrupt steps in the spec with the
?notation.Issue of my proposal: we lose the editorial distinction between the uses of runtime semantics (marked with the action verbs "performing" and "evaluating") and the use of static semantics.
Examples from section 12.2.6.9:
Replace:
with:
Replace:
with:
Replace:
with: