Skip to content
Parser the Programming Language string to Syntax tree
JavaScript Perl Parrot Other
Fetching latest commit…
Cannot retrieve the latest commit at this time.
Failed to load latest commit information.
Grammar
String
.gitignore
readme.pod
spp_test.pl
todos.bat

readme.pod

Name

String::Parser::Spp (String Parser Processor)

interface

use String::Parser::Spp qw(spp);

my $spp_string = spp($grammar_file, $input_file);

# $grammar_file: It should be a filename or string of grmmar # $input_file : The programming language code file or string

usage

Programming language tidy, syntax check, transfer, learning syntax.

Author

 Michael.Song
 qq: 104359176
 Email: perlvim@gmail.com

Grammar syntax

  <1> comment
  introduce the code meaning
  
  syntax : // This is comment
  
  <2> identifier of cluster_name
  cluster name must be an lowercase word: just like:
  string, string_end

  <3> expression
  every expression separate with newline
  
  <rule1> [ /regexp/ | m{replace} ]
  
  <4> delete

  usage: delete the content with abserve the newline

  syntax : delete [ /regexp/ | m{regexp} | "string\n" | <cluster> ]

  todos: If want delelete cluster, in regexp would be captured

  <5> cluster
  
  定义群组 extend this, regexp could include multiple match express

  <cluster_name> [ /regexp/ | m{regexp} | 'keyword' | word | <cluster_name> ]

  <6> conceal
  
  usage: some string with unicode character
  
  syntax : conceal [ word | 'keyword' | <cluster> | /regexp/ | m{regexp} ]

  将单词,字符序列,正则,群组映射成 Unicode 字符(用于调试或优化)
  经常用于临时改变特定结构中的特定字符的含义,以便于做全局性的处理
  
  <7> recover
  
  恢复 recover the string concealed by character

  syntax : recover ( if | endif | else | elseif | '\"' | "\'" | <cluster> )

  恢复单字符所映射的文本,使用大括号为定界符

  <8> exit end the programming
  syntax: exit
Something went wrong with that request. Please try again.