Page Menu
Home
Xreate
Search
Configure Global Search
Log In
Docs
Questions
Repository
Issues
Patches
Internal API
Files
F3996328
modules.ATG
No One
Temporary
Actions
Download File
Edit File
Delete File
View Transforms
Subscribe
Mute Notifications
Subscribers
None
File Metadata
Details
File Info
Storage
Attached
Created
Wed, Jul 8, 10:22 AM
Size
2 KB
Mime Type
text/x-c
Expires
Fri, Jul 10, 10:22 AM (1 d, 9 h)
Engine
blob
Format
Raw Data
Handle
271949
Attached To
rXR Xreate
modules.ATG
View Options
#include "modules.h"
COMPILER Modules
ModuleRecord module;
int nextToken()
{
scanner->ResetPeek();
return scanner->Peek()->kind;
}
bool checkParametersList()
{
return la->kind == _ident && nextToken() == _lparen;
}
CHARACTERS
letter = "ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz".
digit = "0123456789".
any = ANY - '"'.
cr = '\r'.
lf = '\n'.
tab = '\t'.
TOKENS
string = '"' { any } '"'.
ident = (letter | '_') {letter | digit | '_'}.
lparen = '('.
tagcolon = "::".
COMMENTS FROM "/*" TO "*/" NESTED
COMMENTS FROM "//" TO lf
IGNORE cr + lf + tab
PRODUCTIONS
Block =
'{'
{ string
| Block
| ANY
}
'}'.
Modules =
{
ModulesInterface
| SkipXreateOperators
}.
ModulesInterface = "module" (. Expression query; .)
[ tagcolon MetaSimpExpr<query> (. module.addProperty(query); .)
{';' MetaSimpExpr<query> (. module.addProperty(query); .)
}]
('{' {ModulesStatement} '}' | '.').
ModulesStatement = (. std::wstring path; Expression query; .)
( "require" '(' MetaSimpExpr<query> ')' '.' (. module.addRequest(query); .)
| "controller" '(' string (. module.addControllerPath(Atom<String_t>(t->val).get()); .)
')' '.'
| "discover" '(' string (. module.addDiscoveryPath(Atom<String_t>(t->val).get()); .)
')' '.'
).
MetaSimpExpr<Expression& e>= (. Expression e2; .)
( '-' MetaSimpExpr<e2> (. e = Expression(Operator::NEG, {e2}); .)
| ident (. e = Expression(Operator::CALL, {Expression(Atom<Identifier_t>(t->val))}); .)
['(' MetaCalleeParams<e> ')' ]
).
MetaCalleeParams<Expression& e> = (. Expression e2; .)
MetaSimpExpr<e2> (. e.addArg(Expression(e2)); .)
{',' MetaSimpExpr<e2> (. e.addArg(Expression(e2)); .)
}.
SkipXreateOperators =
{ "rule" {ANY} Block
| "interface" {ANY} Block
| "import" {ANY} '.'
| "case" "context" {ANY} Block
| ident '='
(
"function" {ANY} Block
| "type" {ANY} '.'
)
}.
END Modules.
Event Timeline
Log In to Comment