This repository has been archived on 2024-02-27. You can view files and clone it, but cannot push or open issues or pull requests.
arf/analyzer/phrase.go

38 lines
706 B
Go

package analyzer
import "git.tebibyte.media/arf/arf/file"
import "git.tebibyte.media/arf/arf/parser"
import "git.tebibyte.media/arf/arf/infoerr"
type Phrase interface {
// Provided by phraseBase
Location () (location file.Location)
NewError (message string, kind infoerr.ErrorKind) (err error)
// Must be implemented by each individual phrase
ToString (indent int) (output string)
}
type ArbitraryPhrase struct {
phraseBase
command string
arguments []Argument
}
type CastPhrase struct {
phraseBase
command Argument
arguments []Argument
}
// TODO more phrases lol
func (analyzer *analysisOperation) analyzePhrase (
inputPhrase parser.Phrase,
) (
phrase Phrase,
err error,
) {
return
}