Skip to content

Automator EBNF

kajfik edited this page Mar 29, 2021 · 13 revisions

For people who don't know what EBNF is, or who have troubles reading it, try this http://www.bottlecaps.de/rr/ui. Paste into "Edit Grammar" and then switch to "View Diagram"

The 'Preset' terminal is encoded as 'preset' ( ' ' | '\t' )+ [^\s#/]*, even tho the actual regex pattern for it is /preset([ \t]+(\/(?!\/)|[^\s#/])*)?/i, because I'm not sure how to encode the Negative Lookeahead (?!\/) in EBNF.

Script ::= Block
Block ::= Command ( EOL Command )*

Command ::= AutoCommand | BlackHoleCommand | DefineCommand | IfCommand | PauseTimeCommand | PrestigeCommand | StartDilationCommand | StartECCommand | StoreTimeCommand | StudiesBuyCommand | StudiesLoadCommand | StudiesRespecCommand | TTCommand | UnlockDilationCommand | UnlockECCommand | WhileCommand

AutoCommand ::= Auto PrestigeEvent ( On | Off | Duration | XHighestAmount | CurrencyAmount )
BlackHoleCommand ::= BlackHole ( On | Off )
DefineCommand ::= Define Identifier EqualSign ( Duration | StudyList )
PauseTimeCommand ::= Pause ( Duration | Identifier )
PrestigeCommand ::= PrestigeEvent ( Respec )? ( NoWait )?
StartDilationCommand ::= Start Dilation
StartECCommand ::= Start EternityChallenge
StoreTimeCommand ::= StoreTime ( On | Off | Use )
StudiesBuyCommand ::= Studies ( NoWait )? ( StudyList | Identifier )
StudiesLoadCommand ::= Studies Load Preset
StudiesRespecCommand ::= Studies Respec
TTCommand ::= TT TTCurrency
UnlockDilationCommand ::= Unlock Dilation
UnlockECCommand ::= Unlock EternityChallenge
WaitCommand ::= Wait ( Comparison | PrestigeEvent )
UntilCommand ::= Until ( Comparison | PrestigeEvent ) LCurly EOL Block RCurly
WhileCommand ::= While Comparison LCurly EOL Block RCurly
IfCommand ::= If Comparison LCurly EOL Block RCurly

Comparison ::= CompareValue ComparisonOperator CompareValue
CompareValue ::= NumberLiteral | Identifier | Currency
Duration ::= NumberLiteral TimeUnit
EternityChallenge ::= EC NumberLiteral | ECLiteral
StudyList ::= StudyListEntry ( Comma StudyListEntry )* ( Pipe ECNumber )
StudyListEntry ::= StudyRange | NumberLiteral | StudyPath
StudyRange ::= NumberLiteral Dash NumberLiteral
XHighestAmount ::= NumberLiteral XHighest
CurrencyAmount ::= NumberLiteral Currency

EOL ::=  ( ' ' | '\t' | '\r' )* '\n' '\s'*

ComparisonOperator ::= OpGTE | OpLTE | OpGT | OpLT | OpEQ | EqualSign

OpGTE ::= '>='
OpLTE ::= '<='
OpGT ::= '>'
OpLT ::= '<'
OpEQ ::= '=='

LCurly ::= '{'
RCurly ::= '}'
Comma ::= ','
EqualSign ::= '='
Pipe ::= '|'
Dash ::= '-'

NumberLiteral ::= ( '0' | '-'? [1-9] [0-9]* ) ( '.' [0-9]+ )? ( 'e' [+-]? [0-9]+ )?
ECNumber ::= [1-9] [0-9]*

Currency ::= AM | IP | EP | DT | TP | RG | RM | PendingIP | PendingEP | PendingRM | GlyphLevel | Rep | TT | TotalTT | TotalCompletions | PendingCompletions | ECXCompletions

AM ::= 'am'
IP ::= 'ip'
EP ::= 'ep'
DT ::= 'dt'
TP ::= 'tp'
RG ::= 'rg'
RM ::= 'rm'
PendingIP ::= 'pending' ( ' ' | '\t' )+ 'ip'
PendingEP ::= 'pending' ( ' ' | '\t' )+ 'ep'
PendingRM ::= 'pending' ( ' ' | '\t' )+ 'rm'
GlyphLevel ::= 'glyph' ( ' ' | '\t' )+ 'level'
Rep ::= 'rep' | 'replicanti'
TT ::= 'tt'
TotalTT ::= 'total tt'
TotalCompletions ::= 'total' ( ' ' | '\t' )+ 'completions'
PendingCompletions ::= 'pending' ( ' ' | '\t' )+ 'completions'
ECXCompletions ::= 'ec' ECNumber ' completions'
ECLiteral ::= 'ec' ECNumber

Auto ::= 'auto'
Buy ::= 'buy'
Define ::= 'define'
If ::= 'if'
Load ::= 'load'
Max ::= 'max'
Nowait ::= 'nowait'
Off ::= 'off'
On ::= 'on'
Pause ::= 'pause'
Preset ::= 'preset' ( ' ' | '\t' )+ [^\s#/]*
Respec ::= 'respec'
Restart ::= 'restart'
Start ::= 'start'
Studies ::= 'studies'
Unlock ::= 'unlock'
Until ::= 'until'
Use ::= 'use'
Wait ::= 'wait'
While ::= 'while'
BlackHole ::= 'black' ( ' ' | '\t' )+ 'hole'
StoreTime ::= 'store' ( ' ' | '\t' )+ 'time'
Dilation ::= 'dilation'
EC ::= 'ec'
XHighest ::= 'x highest'

PrestigeEvent ::= Infinity | Eternity | Reality

Infinity ::= 'infinity'
Eternity ::= 'eternity'
Reality ::= 'reality'

StudyPath ::= Antimatter | Infinity | Time | Active | Passive | Idle

Antimatter ::= 'antimatter'
Time ::= 'time'
Active ::= 'active'
Passive ::= 'passive'
Idle ::= 'idle'

TTCurrency ::= AM | IP | EP | Max

TimeUnit ::= Milliseconds | Seconds | Minutes | Hours

Milliseconds ::= 'ms'
Seconds ::= 's' ( 'ec' ( 'ond' ( 's' )? )? )?
Minutes ::= 'm' ( 'in' ( 'ute' ( 's' )? )? )?
Hours ::= 'h' ( 'our' ( 's' )? )?

Identifier ::= [a-z] [a-z0-9]*

Clone this wiki locally