def media(rule): rule | (no_ignore('@', 'media'), commas(cssid, False), '{', star(ruleset), '}') rule.astAttrs = { 'media': [cssid], 'rulesets': [ruleset], }
def declare(rule): rule | ('@', CSSID, '(', [commas(expression)], ')', _or(NEWLINE, EOF)) rule.astAttrs = { 'name': { 'type': CSSID, 'single': True }, 'args': expression }
def post_call(rule): rule | ('(', [commas(expression)], ')') rule.astAttrs = {'args': expression}
def declare_args(rule): rule | ('(', [commas(arg)], ')') rule.astAttrs = {'args': arg}
def enumDeclaration(rule): rule | (ENUM, Identifier, ['implements', commas(_type)], enumBody)
def interfaceMethodDeclaratorRest(rule): rule | (formalParameters, star('[' ']'), ['throws', commas(qualifiedName)], ';')
def media(rule): rule | (no_ignore('@', 'media'), commas(cssid, False), '{', star(ruleset), '}') rule.astAttrs = { 'media':[cssid], 'rulesets':[ruleset], }
def methodDeclaratorRest(rule): rule | (formalParameters, star('[' ']'), ['throws', commas(qualifiedName)], _or(methodBody, ';'))
def voidMethodDeclaratorRest(rule): rule | (formalParameters, ['throws', commas(qualifiedName)], _or(methodBody, ';')) rule.astAttrs = { 'parameters' : formalParameters, 'methodBody' : methodBody }
def fieldDeclaration(rule): rule | (commas(variableDeclarator), ';') rule.astAttrs = { 'variables' : variableDeclarator }
def selectors(rule): rule | commas(selector, False) rule.astAttrs = {'selectors': selector}
def ruleset(rule): rule | (commas(selector, False), block) | (plus(_not('}')), '}') rule.astAttrs = { 'selectors': [selector], 'rules':[declaration], }
def list_(rule): rule | ('[', [commas(value)], ']') rule.astAttrs = {'values': [value]}
def voidInterfaceMethodDeclaratorRest(rule): rule | (formalParameters, ['throws', commas(qualifiedName)], ';')
def dict_(rule): rule | ("{", [commas((STRING, ":", value))], "}") rule.astAttrs = {"keys": [STRING], "values": [value]}
def constructorDeclaratorRest(rule): rule | (formalParameters, ['throws', commas(qualifiedName)], constructorBody)
def arguments(rule): rule | ('(', [commas(expression)], ')')
def arrayInitializer(rule): rule | ('{', [ commas(variableInitializer) ], '}') rule.astAttrs = { 'variableInitializer' : variableInitializer }
def normalInterfaceDeclaration(rule): rule | ('interface', Identifier, [typeParameters], ['extends', commas(_type)], interfaceBody)
def typeArguments(rule): rule | ('<', typeArgument, star(commas(typeArgument)), '>') rule.astAttrs = { 'args' : [typeArgument] }
def formalParameters(rule): rule | ('(', [commas(formalParameterDecls)], ')') rule.astAttrs = { 'parameters' : formalParameterDecls }
def import_(rule): rule | (no_ignore('@', 'import'), import_from, [commas(cssid, False)], ';') rule.astAttrs = { 'source': import_from, 'media': [cssid], }
def elementValuePairs(rule): rule | commas(elementValuePair)
def ruleset(rule): rule | (commas(selector, False), block) | (plus(_not('}')), '}') rule.astAttrs = { 'selectors': [selector], 'rules': [declaration], }
def forInit(rule): rule | localVariableDeclaration \ | commas(expression)
def declare(rule): rule | ('@', CSSID, '(', [commas(expression)], ')', _or(NEWLINE, EOF)) rule.astAttrs = {'name': {'type':CSSID, 'single':True}, 'args': expression}
def forUpdate(rule): rule | commas(expression)
def dict_(rule): rule | ('{', [commas((STRING, ':', value))], '}') rule.astAttrs = {'keys': [STRING], 'values': [value]}
def normalClassDeclaration(rule): rule | ('class', Identifier, [typeParameters], ['extends', _type], ['implements' , commas(_type)], classBody) rule.astAttrs = { 'className' : Identifier, 'extends' : _type, 'body' : classBody }
def expressionList(rule): rule | [commas(subExpression)] rule.astAttrs = { 'expressions': [subExpression] }
def nonWildcardTypeArguments(rule): rule | ('<', commas(_type), '>')
def list_(rule): rule | ("[", [commas(value)], "]") rule.astAttrs = {"values": [value]}
def import_(rule): rule | (no_ignore('@', 'import'), import_from, [commas(cssid, False)], ';') rule.astAttrs = { 'source':import_from, 'media':[cssid], }