@@ -16,9 +16,7 @@
|
||||
|
||||
package ast
|
||||
|
||||
import (
|
||||
"github.com/goplus/llgo/chore/llcppg/token"
|
||||
)
|
||||
import "github.com/goplus/llgo/chore/llcppg/token"
|
||||
|
||||
// =============================================================================
|
||||
|
||||
@@ -48,11 +46,6 @@ type PPD interface { // preprocessing directive
|
||||
// =============================================================================
|
||||
// Expressions (Types are also expressions)
|
||||
|
||||
type Token struct {
|
||||
Token token.Token
|
||||
Lit string
|
||||
}
|
||||
|
||||
type BasicLitKind uint
|
||||
|
||||
const (
|
||||
@@ -69,6 +62,8 @@ type BasicLit struct {
|
||||
|
||||
func (*BasicLit) exprNode() {}
|
||||
|
||||
// ------------------------------------------------
|
||||
|
||||
type TypeKind uint
|
||||
|
||||
const (
|
||||
@@ -308,9 +303,14 @@ func (*Include) ppdNode() {}
|
||||
|
||||
// ------------------------------------------------
|
||||
|
||||
type Token struct {
|
||||
Token token.Token
|
||||
Lit string
|
||||
}
|
||||
|
||||
type Macro struct {
|
||||
Name string
|
||||
Info []*Token
|
||||
Tokens []*Token // Tokens[0].Lit is the macro name
|
||||
}
|
||||
|
||||
func (*Macro) ppdNode() {}
|
||||
|
||||
@@ -3,25 +3,30 @@ package token
|
||||
type Token uint
|
||||
|
||||
const (
|
||||
ILLEGAL Token = iota
|
||||
|
||||
/**
|
||||
* A token that contains some kind of punctuation.
|
||||
*/
|
||||
PunctuationToken Token = iota
|
||||
PUNCT
|
||||
|
||||
/**
|
||||
* A language keyword.
|
||||
*/
|
||||
KeywordToken
|
||||
KEYWORD
|
||||
|
||||
/**
|
||||
* An identifier (that is not a keyword).
|
||||
*/
|
||||
IdentifierToken
|
||||
IDENT
|
||||
|
||||
/**
|
||||
* A numeric, string, or character literal.
|
||||
*/
|
||||
LiteralToken
|
||||
LITERAL
|
||||
|
||||
/**
|
||||
* A comment.
|
||||
*/
|
||||
CommentToken
|
||||
COMMENT
|
||||
)
|
||||
|
||||
Reference in New Issue
Block a user