Browsable Rascal Date/Time Grammar

CC-BY

Grammar extracted by Vadim Zaytsev, see the Grammar Zoo entry for details: api/rascal/datetime/extracted
Source used for this grammar: Jurgen J. Vinju, Mark Hills, DateTime, 2009–2013 [Explore]

Summary

Syntax

datetime ::=
	[now]::ε
datetime ::=
	[createDate]::(year⟩:integermonth⟩:integerday⟩:integer)
datetime ::=
	[createTime]::(hour⟩:integerminute⟩:integersecond⟩:integermillisecond⟩:integer)
datetime ::=
	[createTime]::(hour⟩:integerminute⟩:integersecond⟩:integermillisecond⟩:integertimezoneHourOffset⟩:integertimezoneMinuteOffset⟩:integer)
datetime ::=
	[createDateTime]::(year⟩:integermonth⟩:integerday⟩:integerhour⟩:integerminute⟩:integersecond⟩:integermillisecond⟩:integer)
datetime ::=
	[createDateTime]::(year⟩:integermonth⟩:integerday⟩:integerhour⟩:integerminute⟩:integersecond⟩:integermillisecond⟩:integertimezoneHourOffset⟩:integertimezoneMinuteOffset⟩:integer)
datetime ::=
	[joinDateAndTime]::(date⟩:stringtime⟩:string)
tuple[datetime date, datetime time] ::=
	[splitDateTime]::⟨dt⟩:string
datetime ::=
	[incrementYears]::(dt⟩:stringn⟩:integer)
datetime ::=
	[incrementYears]::⟨dt⟩:string
datetime ::=
	[incrementMonths]::(dt⟩:stringn⟩:integer)
datetime ::=
	[incrementMonths]::⟨dt⟩:string
datetime ::=
	[incrementDays]::(dt⟩:stringn⟩:integer)
datetime ::=
	[incrementDays]::⟨dt⟩:string
datetime ::=
	[incrementHours]::(dt⟩:stringn⟩:integer)
datetime ::=
	[incrementHours]::⟨dt⟩:string
datetime ::=
	[incrementMinutes]::(dt⟩:stringn⟩:integer)
datetime ::=
	[incrementMinutes]::⟨dt⟩:string
datetime ::=
	[incrementSeconds]::(dt⟩:stringn⟩:integer)
datetime ::=
	[incrementSeconds]::⟨dt⟩:string
datetime ::=
	[incrementMilliseconds]::(dt⟩:stringn⟩:integer)
datetime ::=
	[incrementMilliseconds]::⟨dt⟩:string
datetime ::=
	[decrementYears]::(dt⟩:stringn⟩:integer)
datetime ::=
	[decrementYears]::⟨dt⟩:string
datetime ::=
	[decrementMonths]::(dt⟩:stringn⟩:integer)
datetime ::=
	[decrementMonths]::⟨dt⟩:string
datetime ::=
	[decrementDays]::(dt⟩:stringn⟩:integer)
datetime ::=
	[decrementDays]::⟨dt⟩:string
datetime ::=
	[decrementHours]::(dt⟩:stringn⟩:integer)
datetime ::=
	[decrementHours]::⟨dt⟩:string
datetime ::=
	[decrementMinutes]::(dt⟩:stringn⟩:integer)
datetime ::=
	[decrementMinutes]::⟨dt⟩:string
datetime ::=
	[decrementSeconds]::(dt⟩:stringn⟩:integer)
datetime ::=
	[decrementSeconds]::⟨dt⟩:string
datetime ::=
	[decrementMilliseconds]::(dt⟩:stringn⟩:integer)
datetime ::=
	[decrementMilliseconds]::⟨dt⟩:string
interval ::=
	[createInterval]::(begin⟩:stringend⟩:string)
tuple[int,int,int,int,int,int,int] ::=
	[createDurationInternal]::(begin⟩:stringend⟩:string)
Duration ::=
	[createDuration]::(begin⟩:stringend⟩:string)
Duration ::=
	[createDuration]::⟨i⟩:interval
int ::=
	[daysInInterval]::⟨i⟩:interval
int ::=
	[daysDiff]::(begin⟩:stringend⟩:string)
list[datetime] ::=
	[dateRangeByDay]::⟨i⟩:interval
datetime ::=
	[parseDate]::(inputDate⟩:stringformatString⟩:string)
datetime ::=
	[parseDateInLocale]::(inputDate⟩:stringformatString⟩:stringlocale⟩:string)
datetime ::=
	[parseTime]::(inputTime⟩:stringformatString⟩:string)
datetime ::=
	[parseTimeInLocale]::(inputTime⟩:stringformatString⟩:stringlocale⟩:string)
datetime ::=
	[parseDateTime]::(inputDateTime⟩:stringformatString⟩:string)
datetime ::=
	[parseDateTimeInLocale]::(inputDateTime⟩:stringformatString⟩:stringlocale⟩:string)
str ::=
	[printDate]::(inputDate⟩:stringformatString⟩:string)
str ::=
	[printDate]::⟨inputDate⟩:string
str ::=
	[printDateInLocale]::(inputDate⟩:stringformatString⟩:stringlocale⟩:string)
str ::=
	[printDateInLocale]::(inputDate⟩:stringlocale⟩:string)
str ::=
	[printTime]::(inputTime⟩:stringformatString⟩:string)
str ::=
	[printTime]::⟨inputTime⟩:string
str ::=
	[printTimeInLocale]::(inputTime⟩:stringformatString⟩:stringlocale⟩:string)
str ::=
	[printTimeInLocale]::(inputTime⟩:stringlocale⟩:string)
str ::=
	[printDateTime]::(inputDateTime⟩:stringformatString⟩:string)
str ::=
	[printDateTime]::⟨inputDateTime⟩:string
str ::=
	[printDateTimeInLocale]::(inputDateTime⟩:stringformatString⟩:stringlocale⟩:string)
str ::=
	[printDateTimeInLocale]::(inputDateTime⟩:stringlocale⟩:string)

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