mirror of
https://gitee.com/BDWare/genparser
synced 2025-04-27 14:32:15 +00:00
feat: update event mechanism
add event type local and global, clients have to use contractID and topic to subscribe local event; allow clients to subscribe topics (will not be recorded)
This commit is contained in:
parent
27ab55c84f
commit
af0637377e
@ -138,15 +138,20 @@ Throw: 'throw';
|
|||||||
Delete: 'delete';
|
Delete: 'delete';
|
||||||
In: 'in';
|
In: 'in';
|
||||||
Try: 'try';
|
Try: 'try';
|
||||||
Event: 'event';
|
Event: 'event';
|
||||||
AtToken: '@';
|
AtToken: '@';
|
||||||
|
|
||||||
/// Event Semantics
|
/// Event Semantics
|
||||||
|
|
||||||
AtLeastOnce: 'AT_LEAST_ONCE';
|
AtLeastOnce: 'AT_LEAST_ONCE';
|
||||||
AtMostOnce: 'AT_MOST_ONCE';
|
AtMostOnce: 'AT_MOST_ONCE';
|
||||||
OnlyOnce: 'ONLY_ONCE';
|
OnlyOnce: 'ONLY_ONCE';
|
||||||
|
|
||||||
|
// Event Global or Local
|
||||||
|
|
||||||
|
Global: 'global';
|
||||||
|
Local: 'local';
|
||||||
|
|
||||||
/// Future Reserved Words
|
/// Future Reserved Words
|
||||||
|
|
||||||
Class: 'class';
|
Class: 'class';
|
||||||
|
@ -69,9 +69,13 @@ eventSemantics
|
|||||||
|OnlyOnce
|
|OnlyOnce
|
||||||
;
|
;
|
||||||
eventDeclaration
|
eventDeclaration
|
||||||
:Event eventSemantics? Identifier SemiColon
|
:Event eventGlobalOrLocal? Identifier SemiColon
|
||||||
// |Event eventSemantics? Identifier '(' annotationArgs? ')' SemiColon
|
|Event eventGlobalOrLocal? Identifier '(' eventSemantics? ')' SemiColon
|
||||||
;
|
;
|
||||||
|
eventGlobalOrLocal
|
||||||
|
:Global
|
||||||
|
|Local
|
||||||
|
;
|
||||||
sourceElement
|
sourceElement
|
||||||
: statement
|
: statement
|
||||||
;
|
;
|
||||||
|
Loading…
x
Reference in New Issue
Block a user