AlexaClientSDK  3.0.0
A cross-platform, modular SDK for interacting with the Alexa Voice Service
Classes | Functions | Variables
pump Namespace Reference

Classes

class  CodeNode
 
class  Cursor
 
class  ElseNode
 
class  Env
 
class  ExpNode
 
class  ForNode
 
class  IfNode
 
class  LiteralDollarNode
 
class  Output
 
class  RangeNode
 
class  RawCodeNode
 
class  Token
 
class  VarNode
 

Functions

def Eof ()
 
def StartsWith (lines, pos, string)
 
def FindFirstInLine (line, token_table)
 
def FindFirst (lines, token_table, cursor)
 
def SubString (lines, start, end)
 
def StripMetaComments (str)
 
def MakeToken (lines, start, end, token_type)
 
def ParseToken (lines, pos, regex, token_type)
 
def Skip (lines, pos, regex)
 
def SkipUntil (lines, pos, regex, token_type)
 
def ParseExpTokenInParens (lines, pos)
 
def RStripNewLineFromToken (token)
 
def TokenizeLines (lines, pos)
 
def Tokenize (s)
 
def PopFront (a_list)
 
def PushFront (a_list, elem)
 
def PopToken (a_list, token_type=None)
 
def PeekToken (a_list)
 
def ParseExpNode (token)
 
def ParseElseNode (tokens)
 
def ParseAtomicCodeNode (tokens)
 
def ParseCodeNode (tokens)
 
def ParseToAST (pump_src_text)
 
def RunAtomicCode (env, node, output)
 
def RunCode (env, code_node, output)
 
def IsSingleLineComment (cur_line)
 
def IsInPreprocessorDirective (prev_lines, cur_line)
 
def WrapComment (line, output)
 
def WrapCode (line, line_concat, output)
 
def WrapPreprocessorDirective (line, output)
 
def WrapPlainCode (line, output)
 
def IsMultiLineIWYUPragma (line)
 
def IsHeaderGuardIncludeOrOneLineIWYUPragma (line)
 
def WrapLongLine (line, output)
 
def BeautifyCode (string)
 
def ConvertFromPumpSource (src_text)
 
def main (argv)
 

Variables

list TOKEN_TABLE
 
 ID_REGEX = re.compile(r'[_A-Za-z]\w*')
 
 EQ_REGEX = re.compile(r'=')
 
 REST_OF_LINE_REGEX = re.compile(r'.*?(?=$|\$\$)')
 
 OPTIONAL_WHITE_SPACES_REGEX = re.compile(r'\s*')
 
 WHITE_SPACE_REGEX = re.compile(r'\s')
 
 DOT_DOT_REGEX = re.compile(r'\.\.')
 

Function Documentation

◆ BeautifyCode()

def pump.BeautifyCode (   string)

◆ ConvertFromPumpSource()

def pump.ConvertFromPumpSource (   src_text)
Return the text generated from the given Pump source text.

◆ Eof()

def pump.Eof ( )
Returns the special cursor to denote the end-of-file.

◆ FindFirst()

def pump.FindFirst (   lines,
  token_table,
  cursor 
)
Finds the first occurrence of any string in strings in lines.

◆ FindFirstInLine()

def pump.FindFirstInLine (   line,
  token_table 
)

◆ IsHeaderGuardIncludeOrOneLineIWYUPragma()

def pump.IsHeaderGuardIncludeOrOneLineIWYUPragma (   line)

◆ IsInPreprocessorDirective()

def pump.IsInPreprocessorDirective (   prev_lines,
  cur_line 
)

◆ IsMultiLineIWYUPragma()

def pump.IsMultiLineIWYUPragma (   line)

◆ IsSingleLineComment()

def pump.IsSingleLineComment (   cur_line)

◆ main()

def pump.main (   argv)

◆ MakeToken()

def pump.MakeToken (   lines,
  start,
  end,
  token_type 
)
Creates a new instance of Token.

◆ ParseAtomicCodeNode()

def pump.ParseAtomicCodeNode (   tokens)

◆ ParseCodeNode()

def pump.ParseCodeNode (   tokens)

◆ ParseElseNode()

def pump.ParseElseNode (   tokens)

◆ ParseExpNode()

def pump.ParseExpNode (   token)

◆ ParseExpTokenInParens()

def pump.ParseExpTokenInParens (   lines,
  pos 
)

◆ ParseToAST()

def pump.ParseToAST (   pump_src_text)
Convert the given Pump source text into an AST.

◆ ParseToken()

def pump.ParseToken (   lines,
  pos,
  regex,
  token_type 
)

◆ PeekToken()

def pump.PeekToken (   a_list)

◆ PopFront()

def pump.PopFront (   a_list)

◆ PopToken()

def pump.PopToken (   a_list,
  token_type = None 
)

◆ PushFront()

def pump.PushFront (   a_list,
  elem 
)

◆ RStripNewLineFromToken()

def pump.RStripNewLineFromToken (   token)

◆ RunAtomicCode()

def pump.RunAtomicCode (   env,
  node,
  output 
)

◆ RunCode()

def pump.RunCode (   env,
  code_node,
  output 
)

◆ Skip()

def pump.Skip (   lines,
  pos,
  regex 
)

◆ SkipUntil()

def pump.SkipUntil (   lines,
  pos,
  regex,
  token_type 
)

◆ StartsWith()

def pump.StartsWith (   lines,
  pos,
  string 
)
Returns True iff the given position in lines starts with 'string'.

◆ StripMetaComments()

def pump.StripMetaComments (   str)
Strip meta comments from each line in the given string.

◆ SubString()

def pump.SubString (   lines,
  start,
  end 
)
Returns a substring in lines.

◆ Tokenize()

def pump.Tokenize (   s)
A generator that yields the tokens in the given string.

◆ TokenizeLines()

def pump.TokenizeLines (   lines,
  pos 
)

◆ WrapCode()

def pump.WrapCode (   line,
  line_concat,
  output 
)

◆ WrapComment()

def pump.WrapComment (   line,
  output 
)

◆ WrapLongLine()

def pump.WrapLongLine (   line,
  output 
)

◆ WrapPlainCode()

def pump.WrapPlainCode (   line,
  output 
)

◆ WrapPreprocessorDirective()

def pump.WrapPreprocessorDirective (   line,
  output 
)

Variable Documentation

◆ DOT_DOT_REGEX

pump.DOT_DOT_REGEX = re.compile(r'\.\.')

◆ EQ_REGEX

pump.EQ_REGEX = re.compile(r'=')

◆ ID_REGEX

pump.ID_REGEX = re.compile(r'[_A-Za-z]\w*')

◆ OPTIONAL_WHITE_SPACES_REGEX

pump.OPTIONAL_WHITE_SPACES_REGEX = re.compile(r'\s*')

◆ REST_OF_LINE_REGEX

pump.REST_OF_LINE_REGEX = re.compile(r'.*?(?=$|\$\$)')

◆ TOKEN_TABLE

list pump.TOKEN_TABLE
Initial value:
1 = [
2  (re.compile(r'\$var\s+'), '$var'),
3  (re.compile(r'\$elif\s+'), '$elif'),
4  (re.compile(r'\$else\s+'), '$else'),
5  (re.compile(r'\$for\s+'), '$for'),
6  (re.compile(r'\$if\s+'), '$if'),
7  (re.compile(r'\$range\s+'), '$range'),
8  (re.compile(r'\$[_A-Za-z]\w*'), '$id'),
9  (re.compile(r'\$\(\$\)'), '$($)'),
10  (re.compile(r'\$'), '$'),
11  (re.compile(r'\[\[\n?'), '[['),
12  (re.compile(r'\]\]\n?'), ']]'),
13  ]

◆ WHITE_SPACE_REGEX

pump.WHITE_SPACE_REGEX = re.compile(r'\s')

AlexaClientSDK 3.0.0 - Copyright 2016-2022 Amazon.com, Inc. or its affiliates. All Rights Reserved. Licensed under the Apache License, Version 2.0