Too Long; Didn't Read
Code formatter is an essential tool in programmers' day-to-day jobs, but did you ask yourself how it works? I will talk in detail how simple code formatter work and how I implemented in Turtle Graphics app. The first step is to read a text file and convert it into a list of tokens, A token is a class that represents a keyword, number, bracket, string, …etc with this position in the source code for example. The result is a List of tokens for example, a class of tokens.