-
Notifications
You must be signed in to change notification settings - Fork 2
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
added more Ast implementation classes
- Loading branch information
Showing
18 changed files
with
258 additions
and
33 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,11 @@ | ||
from osbot_utils.utils.Dev import pprint | ||
from osbot_utils.utils.ast.Ast_Node import Ast_Node | ||
|
||
class Ast_Assign(Ast_Node): | ||
|
||
def __repr__(self): | ||
return f'[Ast_Node][Ast_Assign]' | ||
|
||
def info(self): | ||
return {'Ast_Assign': {'targets': self.targets(), | ||
'value' : self.value() }} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,12 @@ | ||
from osbot_utils.utils.Dev import pprint | ||
from osbot_utils.utils.ast.Ast_Node import Ast_Node | ||
|
||
class Ast_Attribute(Ast_Node): | ||
|
||
def __repr__(self): | ||
return f'[Ast_Node][Ast_Attribute]' | ||
|
||
def info(self): | ||
return {'Ast_Attribute': { 'attr' : self.node.attr , | ||
'ctx' : self.ctx()} , | ||
'value' : self.value() } |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,12 @@ | ||
from osbot_utils.utils.Dev import pprint | ||
from osbot_utils.utils.ast.Ast_Node import Ast_Node | ||
|
||
class Ast_Call(Ast_Node): | ||
|
||
def __repr__(self): | ||
return f'[Ast_Node][Ast_Call]' | ||
|
||
def info(self): | ||
return {'Ast_Call': { 'args' : self.args() , | ||
'func' : self.func() , | ||
'keywords': self.keywords()}} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,12 @@ | ||
from osbot_utils.utils.ast.Ast_Node import Ast_Node | ||
|
||
class Ast_Class_Def(Ast_Node): | ||
|
||
def __repr__(self): | ||
return f'[Ast_Node][Ast_Class_Def]' | ||
|
||
def info(self): | ||
#self.print() | ||
return {'Ast_Class_Def': {'bases': self.bases() , | ||
'body' : self.body() , | ||
'name' : self.node.name}} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,11 @@ | ||
from osbot_utils.utils.Dev import pprint | ||
from osbot_utils.utils.ast.Ast_Node import Ast_Node | ||
|
||
class Ast_Dict(Ast_Node): | ||
|
||
def __repr__(self): | ||
return f'[Ast_Node][Ast_Dict]' | ||
|
||
def info(self): | ||
return {'Ast_Dict': { 'keys' : self.keys() , | ||
'values': self.values()}} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,10 @@ | ||
from osbot_utils.utils.Dev import pprint | ||
from osbot_utils.utils.ast.Ast_Node import Ast_Node | ||
|
||
class Ast_Expr(Ast_Node): | ||
|
||
def __repr__(self): | ||
return f'[Ast_Node][Ast_Expr]' | ||
|
||
def info(self): | ||
return {'Ast_Expr': { 'value' : self.value() }} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,10 @@ | ||
from osbot_utils.utils.ast.Ast_Node import Ast_Node | ||
|
||
class Ast_Load(Ast_Node): | ||
|
||
def __repr__(self): | ||
return f'[Ast_Node][Ast_Load]' | ||
|
||
def info(self): | ||
#self.print() | ||
return {'Ast_Load': {}} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,9 @@ | ||
from osbot_utils.utils.ast.Ast_Node import Ast_Node | ||
|
||
class Ast_Name(Ast_Node): | ||
|
||
def __repr__(self): | ||
return f'[Ast_Node][Ast_Name]' | ||
|
||
def info(self): | ||
return {'Ast_Name': {'ctx': self.ast_node(self.node.ctx)}} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,10 @@ | ||
from osbot_utils.utils.Dev import pprint | ||
from osbot_utils.utils.ast.Ast_Node import Ast_Node | ||
|
||
class Ast_Store(Ast_Node): | ||
|
||
def __repr__(self): | ||
return f'[Ast_Node][Ast_Store]' | ||
|
||
def info(self): | ||
return {'Ast_Store': {}} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Oops, something went wrong.