Skip to content
Projects
Groups
Snippets
Help
Loading...
Sign in
Toggle navigation
A
arpeggio-gm
Project
Project
Details
Activity
Cycle Analytics
Repository
Repository
Files
Commits
Branches
Tags
Contributors
Graph
Compare
Charts
Issues
0
Issues
0
List
Board
Labels
Milestones
Merge Requests
0
Merge Requests
0
Wiki
Wiki
Snippets
Snippets
Members
Members
Collapse sidebar
Close sidebar
Activity
Graph
Charts
Create a new issue
Commits
Issue Boards
Open sidebar
backend
arpeggio-gm
Commits
ac6afe41
Commit
ac6afe41
authored
Aug 06, 2014
by
Igor Dejanovic
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
Some common semantic actions.
parent
f6fa97f1
Hide whitespace changes
Inline
Side-by-side
Showing
1 changed file
with
16 additions
and
0 deletions
+16
-0
__init__.py
arpeggio/__init__.py
+16
-0
No files found.
arpeggio/__init__.py
View file @
ac6afe41
...
@@ -835,6 +835,22 @@ class SemanticActionResults(object):
...
@@ -835,6 +835,22 @@ class SemanticActionResults(object):
return
self
.
results
.
get
(
attr_name
,
[])
return
self
.
results
.
get
(
attr_name
,
[])
# Common semantic actions
class
SemanticActionSingleChild
(
SemanticAction
):
def
first_pass
(
self
,
parser
,
node
,
children
):
return
children
[
0
]
class
SemanticActionBodyWithBraces
(
SemanticAction
):
def
first_pass
(
self
,
parser
,
node
,
children
):
return
children
[
1
:
-
1
]
class
SemanticActionToString
(
SemanticAction
):
def
first_pass
(
self
,
parser
,
node
,
children
):
return
str
(
node
)
# ----------------------------------------------------
# ----------------------------------------------------
# Parsers
# Parsers
...
...
Write
Preview
Markdown
is supported
0%
Try again
or
attach a new file
Attach a file
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Cancel
Please
register
or
sign in
to comment