Skip to content
Permalink
Browse files
Start of experiment with a basic calculator.
This is a throwaway so I can debug some of the HLSL parsing code, and get a
 better idea of what I want to do there. This will eventually merge back
 into the default branch with the right bits going into the compiler code.

--HG--
branch : calculator-experiment
  • Loading branch information
icculus committed Feb 8, 2010
1 parent 10ec4cb commit 963fd467cb86f75933f59e37709585689c89dcb0
Showing with 616 additions and 0 deletions.
  1. +15 −0 CMakeLists.txt
  2. +412 −0 calculator.c
  3. +185 −0 calculator.lemon
  4. +4 −0 mojoshader_internal.h
@@ -76,6 +76,21 @@ SET_SOURCE_FILES_PROPERTIES(
PROPERTIES OBJECT_DEPENDS "${CMAKE_CURRENT_SOURCE_DIR}/mojoshader_parser_hlsl.h"
)

# Calculator test stuff...
ADD_CUSTOM_COMMAND(
OUTPUT "${CMAKE_CURRENT_SOURCE_DIR}/calculator.h"
MAIN_DEPENDENCY "${CMAKE_CURRENT_SOURCE_DIR}/calculator.lemon"
DEPENDS lemon "${CMAKE_CURRENT_SOURCE_DIR}/misc/lempar.c"
COMMAND "${LEMON}"
ARGS -q "-T${CMAKE_CURRENT_SOURCE_DIR}/misc/lempar.c" "${CMAKE_CURRENT_SOURCE_DIR}/calculator.lemon"
)
SET_SOURCE_FILES_PROPERTIES(
calculator.c
PROPERTIES OBJECT_DEPENDS "${CMAKE_CURRENT_SOURCE_DIR}/calculator.h"
)
ADD_EXECUTABLE(calculator calculator.c)
TARGET_LINK_LIBRARIES(calculator mojoshader)

FIND_PROGRAM(RE2C re2c DOC "Path to re2c command line app: http://re2c.org/")
IF(NOT RE2C)
MESSAGE(STATUS "re2c missing. You can go on, but can't rebuild the lexer.")

0 comments on commit 963fd46

Please sign in to comment.