Code
Hub
Workspaces
Following
Trending
Connect
MCP
copy
Create free account
hub
/
github.com/MauriceGit/compiler
/ functions
Functions
362 in github.com/MauriceGit/compiler
⨍
Functions
362
◇
Types & classes
37
↓ 388 callers
Method
addLine
(command, args string)
codeGeneration.go:77
↓ 63 callers
Method
expect
expect checks the next token against a given expected type and value and returns true, if the check was valid.
parser.go:967
↓ 60 callers
Function
newVar
(value string, shadow bool)
parser_test.go:234
↓ 51 callers
Function
newConst
(t Type, value string)
parser_test.go:243
↓ 51 callers
Function
tokenIdentifier
(s string)
lexer_test.go:25
↓ 46 callers
Method
addLabel
(label string)
codeGeneration.go:63
↓ 45 callers
Function
tokenConstant
(s string)
lexer_test.go:13
↓ 38 callers
Function
getReturnRegister
(t Type)
codeGeneration.go:190
↓ 38 callers
Function
newAssignment
(variables []Variable, expressions []Expression)
parser_test.go:255
↓ 31 callers
Method
getExpressionTypes
(s *SymbolTable)
parser.go:179
↓ 30 callers
Method
generateCode
(asm *ASM, s *SymbolTable)
parser.go:166
↓ 27 callers
Method
nextLabelName
()
codeGeneration.go:53
↓ 25 callers
Function
compileAndRun
(program []byte)
compiler_test.go:9
↓ 25 callers
Function
getRegister
(t Type)
codeGeneration.go:162
↓ 25 callers
Function
newBinary
(op Operator, eLeft, eRight Expression, fixed bool)
parser_test.go:249
↓ 24 callers
Function
tokenKeyword
(s string)
lexer_test.go:7
↓ 23 callers
Function
tokenAssignment
()
lexer_test.go:10
↓ 23 callers
Function
tokenOperator
(s string)
lexer_test.go:28
↓ 20 callers
Method
startPos
Notes the start position in the actual source code! (lineNr, columnNr)
parser.go:165
↓ 20 callers
Function
tokenSeparator
()
lexer_test.go:43
↓ 19 callers
Method
addFun
(name string, inline bool)
codeGeneration.go:66
↓ 19 callers
Method
funIsInline
(name string, paramTypes []ComplexType, strict bool)
semanticAnalyzer.go:168
↓ 19 callers
Method
funIsUsed
(name string, paramTypes []ComplexType, strict bool)
semanticAnalyzer.go:174
↓ 19 callers
Method
getResultCount
()
parser.go:180
↓ 19 callers
Method
nextFunctionName
()
codeGeneration.go:58
↓ 19 callers
Method
setFun
(name string, argTypes, returnTypes []ComplexType, inline bool)
semanticAnalyzer.go:58
↓ 19 callers
Method
setFunAsmName
(v string, asmName string, paramTypes []ComplexType, strict bool)
semanticAnalyzer.go:147
↓ 17 callers
Method
getFun
(name string, paramTypes []ComplexType, strict bool)
semanticAnalyzer.go:87
↓ 16 callers
Function
newAST
(statements []Statement)
parser_test.go:276
↓ 16 callers
Method
pushBack
(t Token)
parser.go:822
↓ 16 callers
Function
testAST
(code []byte, expected AST, t *testing.T)
parser_test.go:211
↓ 15 callers
Function
newBlock
(statements []Statement)
parser_test.go:273
↓ 15 callers
Function
testTokens
(code []byte, expect []Token, t *testing.T)
lexer_test.go:65
↓ 15 callers
Function
tokenEOF
()
lexer_test.go:52
↓ 14 callers
Function
analyzeExpression
(expression Expression, symbolTable *SymbolTable)
semanticAnalyzer.go:707
↓ 14 callers
Method
createToken
(t TokenType, v string, line, column int)
parser.go:818
↓ 14 callers
Method
expectType
expectType checks the next token against a given expected type and returns the token string with corresponding line and column numbers
parser.go:955
↓ 13 callers
Method
getMemCount
(symbolTable *SymbolTable)
parser.go:880
↓ 12 callers
Function
equalType
PARSER IMPLEMENTATION Sometimes, we are OK with non strict equality, i.e. if we only need an array and don't care about the actual type.
parser.go:832
↓ 12 callers
Function
tokenCurlyClose
()
lexer_test.go:19
↓ 12 callers
Function
tokenCurlyOpen
()
lexer_test.go:16
↓ 10 callers
Method
getVar
getVar goes through all symbol varTables recursively and looks for an entry for the given variable name v
semanticAnalyzer.go:8
↓ 10 callers
Function
tokenParenClose
()
lexer_test.go:34
↓ 10 callers
Function
tokenParenOpen
()
lexer_test.go:31
↓ 9 callers
Function
getFunctionRegisters
Right now we limit ourself to a maximum of 6 integer parameters and/or 8 floating parameters! https://wiki.cdot.senecacollege.ca/wiki/X86_64_Register_
codeGeneration.go:204
↓ 9 callers
Function
parseExpression
(tokens *TokenChannel)
parser.go:1387
↓ 8 callers
Method
isDirectlyAccessed
()
parser.go:181
↓ 8 callers
Function
parseBlock
(tokens *TokenChannel)
parser.go:2143
↓ 8 callers
Function
tokenSemicolon
()
lexer_test.go:22
↓ 7 callers
Function
analyzeBlock
analyzeBlock gets a reference to the current (now parent) symbol varTable Additionally, it might get a pre-filled symbol varTable for the new scope to
semanticAnalyzer.go:1209
↓ 7 callers
Method
setFunIsUsed
(name string, isUsed bool)
codeGeneration.go:69
↓ 7 callers
Function
variablesToTypes
(variables []Variable)
codeGeneration.go:1191
↓ 6 callers
Method
getMemTypes
(symbolTable *SymbolTable)
parser.go:866
↓ 6 callers
Method
getType
(v string)
semanticAnalyzer.go:48
↓ 6 callers
Function
parseExpressionList
(tokens *TokenChannel)
parser.go:1444
↓ 6 callers
Method
setFunIsUsed
(v string, paramTypes []ComplexType, isUsed bool)
semanticAnalyzer.go:204
↓ 6 callers
Function
tokenSquareClose
()
lexer_test.go:40
↓ 6 callers
Function
tokenSquareOpen
()
lexer_test.go:37
↓ 5 callers
Method
addSysConstant
(name, value string)
codeGeneration.go:46
↓ 5 callers
Function
compareBlock
(ss1, ss2 Block)
parser_test.go:194
↓ 5 callers
Function
compareExpressions
(ee1, ee2 []Expression)
parser_test.go:108
↓ 5 callers
Function
equalTypes
(l1, l2 []ComplexType, strict bool)
parser.go:844
↓ 5 callers
Method
setVar
(v string, t ComplexType, isIndexed bool)
semanticAnalyzer.go:34
↓ 4 callers
Method
String
AST, OPS STRING
parser.go:501
↓ 4 callers
Method
addConstant
(value string)
codeGeneration.go:35
↓ 4 callers
Function
analyzeDirectAccess
(t ComplexType, directAccess []DirectAccess, symbolTable *SymbolTable)
semanticAnalyzer.go:401
↓ 4 callers
Function
expressionsToTypes
(expressions []Expression, s *SymbolTable)
codeGeneration.go:568
↓ 4 callers
Function
getAccessedType
(c ComplexType, access []DirectAccess, s *SymbolTable)
parser.go:271
↓ 4 callers
Function
newArray
(t ComplexType, count int, exprs []Expression)
parser_test.go:252
↓ 4 callers
Function
newFunction
(name string, params []Variable, returnTypes []ComplexType, b Block)
parser_test.go:264
↓ 4 callers
Function
newLoop
(a Assignment, exprs []Expression, incrA Assignment, b Block)
parser_test.go:261
↓ 4 callers
Function
newParam
(t ComplexType, value string)
parser_test.go:240
↓ 4 callers
Method
priority
Operator priority (Descending priority!): 0: '-', '!' 1: '*', '/', '%' 2: '+', '-' 3: '==', '!=', '<=', '>=', '<', '>' 4: '&&' 5: '||'
parser.go:898
↓ 4 callers
Function
typesToMemCount
(ct []ComplexType, symbolTable *SymbolTable)
parser.go:884
↓ 3 callers
Function
analyzeAssignment
Returns newly created variables and variables that should shadow others! This is just for housekeeping and removing them later!!!! All new variables (
semanticAnalyzer.go:736
↓ 3 callers
Function
analyzeType
analyzeType recursively goes through the type hierarchy and checks, if all types are well defined.
semanticAnalyzer.go:1126
↓ 3 callers
Function
compareExpression
(e1, e2 Expression)
parser_test.go:68
↓ 3 callers
Function
compareIndexExpression
(e1, e2 Expression)
parser_test.go:12
↓ 3 callers
Function
generateDirectAccessCode
We don't know where we were before and what expression needs to be indexed. All we care about, is that the array pointer is in rax and the resulting v
codeGeneration.go:266
↓ 3 callers
Function
getOperatorType
(o string)
parser.go:918
↓ 3 callers
Function
newCondition
(e Expression, block, elseBlock Block)
parser_test.go:258
↓ 3 callers
Function
newReturn
(expressions []Expression)
parser_test.go:267
↓ 3 callers
Function
newUnary
(op Operator, e Expression)
parser_test.go:246
↓ 3 callers
Function
parseAssignment
parseBlock parses a list of statements from the tokens.
parser.go:1475
↓ 3 callers
Function
parseType
(tokens *TokenChannel)
parser.go:1870
↓ 3 callers
Function
tokenize
(program []byte, tokens chan Token, err chan error)
lexer.go:119
↓ 2 callers
Function
addFunctionEpilogue
(asm *ASM)
codeGeneration.go:1097
↓ 2 callers
Function
addFunctionPrologue
(asm *ASM, variableStackSpace int)
codeGeneration.go:1079
↓ 2 callers
Function
addIndexAccess
(e, indexExpression Expression)
parser_test.go:286
↓ 2 callers
Method
addRawLine
(command string)
codeGeneration.go:83
↓ 2 callers
Method
allPathsReturn
()
functionReturnAnalysis.go:31
↓ 2 callers
Function
analyzeFunCall
(fun FunCall, symbolTable *SymbolTable)
semanticAnalyzer.go:565
↓ 2 callers
Method
assignVariableStackOffset
assignVariableStackOffset just makes sure, that every single local variable has a defined stack position for the rest of its scope! If we are within a
codeGeneration.go:1170
↓ 2 callers
Function
compareFunCall
(v1, v2 FunCall)
parser_test.go:44
↓ 2 callers
Function
compareTypes
(tt1, tt2 []ComplexType)
parser_test.go:133
↓ 2 callers
Function
compareVariable
(v1, v2 Variable)
parser_test.go:37
↓ 2 callers
Function
compareVariables
First time really where I have to say - **** generics (in - not having them!)
parser_test.go:121
↓ 2 callers
Function
compile
(program []byte, sourceFile, binFile string)
compiler.go:160
↓ 2 callers
Function
filterVarType
(t Type, vars []Variable)
codeGeneration.go:1109
↓ 2 callers
Method
getDirectAccess
()
parser.go:182
next →
1–100 of 362, ranked by callers