Browsable Rascal String Grammar

CC-BY

Grammar extracted by Vadim Zaytsev, see the Grammar Zoo entry for details: api/rascal/string/extracted
Source used for this grammar: Jurgen J. Vinju, Tijs van der Storm, Paul Klint, Arnold Lankamp, Vadim Zaytsev, String, 2009–2013 [Explore]

Summary

Syntax

str ::=
	[center]::(s⟩:stringn⟩:integer)
str ::=
	[center]::(s⟩:stringn⟩:integerpad⟩:string)
int ::=
	[charAt]::(s⟩:stringi⟩:integer)
list[int] ::=
	[chars]::⟨s⟩:string
bool ::=
	[contains]::(input⟩:stringfind⟩:string)
bool ::=
	[endsWith]::(subject⟩:stringsuffix⟩:string)
str ::=
	[escape]::(subject⟩:stringmapping⟩:(string string)*)
list[int] ::=
	[findAll]::(subject⟩:stringfind⟩:string)
int ::=
	[findFirst]::(subject⟩:stringfind⟩:string)
int ::=
	[findLast]::(subject⟩:stringfind⟩:string)
bool ::=
	[isEmpty]::⟨s⟩:string
str ::=
	[left]::(s⟩:stringn⟩:integer)
str ::=
	[left]::(s⟩:stringn⟩:integerpad⟩:string)
str ::=
	[replaceAll]::(subject⟩:stringfind⟩:stringreplacement⟩:string)
str ::=
	[replaceFirst]::(subject⟩:stringfind⟩:stringreplacement⟩:string)
str ::=
	[replaceLast]::(subject⟩:stringfind⟩:stringreplacement⟩:string)
str ::=
	[reverse]::⟨s⟩:string
str ::=
	[right]::(s⟩:stringn⟩:integer)
str ::=
	[right]::(s⟩:stringn⟩:integerpad⟩:string)
int ::=
	[size]::⟨s⟩:string
bool ::=
	[startsWith]::(subject⟩:stringprefix⟩:string)
str ::=
	[stringChar]::⟨char⟩:integer
str ::=
	[stringChars]::⟨chars⟩:integer*
bool ::=
	[isValidCharacter]::⟨ch⟩:integer
str ::=
	[substring]::(s⟩:stringbegin⟩:integer)
str ::=
	[substring]::(s⟩:stringbegin⟩:integerend⟩:integer)
int ::=
	[toInt]::⟨s⟩:string
int ::=
	[toInt]::(s⟩:stringr⟩:integer)
str ::=
	[toLowerCase]::⟨s⟩:string
real ::=
	[toReal]::⟨s⟩:string
str ::=
	[toUpperCase]::⟨s⟩:string
str ::=
	[trim]::⟨s⟩:string
str ::=
	[squeeze]::(src⟩:stringcharSet⟩:string)
list[str] ::=
	[split]::(sep⟩:stringsrc⟩:string)
str ::=
	[capitalize]::⟨src⟩:string
str ::=
	[uncapitalize]::⟨src⟩:string
str ::=
	[wrap]::(src⟩:stringwrapLength⟩:integer)
str ::=
	[format]::(s⟩:stringdir⟩:stringn⟩:integerpad⟩:string)
bool ::=
	[rexpMatch]::(s⟩:stringre⟩:string)
loc ::=
	[toLocation]::⟨s⟩:string
str ::=
	[subst1]::(src⟩:stringx⟩:stringy⟩:string)
str ::=
	[substitute]::(src⟩:strings⟩:(string string)*)

GrammarLabMaintained by Dr. Vadim Zaytsev a.k.a. @grammarware. Last updated in September 2015. []