From d1eb4fd5dea3b49429c959a8d630acdba62865d5 Mon Sep 17 00:00:00 2001 From: Robert Osfield Date: Thu, 25 Jun 2009 13:31:48 +0000 Subject: [PATCH] Converted tabs to spaces --- src/osgPlugins/cfg/ConfigParser.y | 562 +++++++++++++++--------------- 1 file changed, 281 insertions(+), 281 deletions(-) diff --git a/src/osgPlugins/cfg/ConfigParser.y b/src/osgPlugins/cfg/ConfigParser.y index 162daf168..f25cf6e24 100644 --- a/src/osgPlugins/cfg/ConfigParser.y +++ b/src/osgPlugins/cfg/ConfigParser.y @@ -142,13 +142,13 @@ static int yylex() %% config : entries - ; + ; entries : entry | entries entry - ; + ; entry : visual | render_surface | camera | input_area | camera_group | stereo_param | system_params - ; + ; system_params : system_param | system_params system_param ; @@ -183,35 +183,35 @@ cameras : /* null */ | camera | cameras camera ; camera : PRTOKEN_CAMERA name - { - cfg->beginCamera( $2 ); - } - '{' camera_attributes '}' - { - cfg->endCamera(); - }; + { + cfg->beginCamera( $2 ); + } + '{' camera_attributes '}' + { + cfg->endCamera(); + }; camera_attributes : camera_attribute | camera_attributes camera_attribute - ; + ; camera_attribute : - /* EMPTY */ - | PRTOKEN_RENDER_SURFACE name ';' - { - cfg->setCameraRenderSurface( $2 ); - } - | render_surface - { - cfg->setCameraRenderSurface(); - } - | PRTOKEN_PROJECTION_RECT real real real real ';' - { - cfg->setCameraProjectionRectangle( $2, $3, $4, $5 ); - } - | PRTOKEN_SHARELENS bool ';' - { - cfg->setCameraShareLens( $2 ); - } + /* EMPTY */ + | PRTOKEN_RENDER_SURFACE name ';' + { + cfg->setCameraRenderSurface( $2 ); + } + | render_surface + { + cfg->setCameraRenderSurface(); + } + | PRTOKEN_PROJECTION_RECT real real real real ';' + { + cfg->setCameraProjectionRectangle( $2, $3, $4, $5 ); + } + | PRTOKEN_SHARELENS bool ';' + { + cfg->setCameraShareLens( $2 ); + } | PRTOKEN_SHAREVIEW bool ';' { cfg->setCameraShareView( $2 ); @@ -220,45 +220,45 @@ camera_attribute : { cfg->setCameraClearColor( $2, $3, $4, $5 ); } - | lens - | camera_offset - ; + | lens + | camera_offset + ; camera_offset : PRTOKEN_OFFSET '{' - { - cfg->beginCameraOffset(); - } - camera_offset_attributes '}' - { - cfg->endCameraOffset(); - } - ; + { + cfg->beginCameraOffset(); + } + camera_offset_attributes '}' + { + cfg->endCameraOffset(); + } + ; camera_offset_attributes : camera_offset_attribute | camera_offset_attributes camera_offset_attribute - ; + ; camera_offset_attribute : - PRTOKEN_SHEAR real real ';' - { - cfg->shearCameraOffset( $2, $3 ); - } - | PRTOKEN_ROTATE real real real real ';' - { - cfg->rotateCameraOffset( $2, $3, $4, $5 ); - } - | PRTOKEN_TRANSLATE real real real ';' - { - cfg->translateCameraOffset( $2, $3, $4 ); - } - | PRTOKEN_SCALE real real real ';' - { - cfg->scaleCameraOffset( $2, $3, $4 ); - } - | PRTOKEN_METHOD offset_multiply_method ';' - { - cfg->setCameraOffsetMultiplyMethod( (Producer::Camera::Offset::MultiplyMethod)$2 ); - } - ; + PRTOKEN_SHEAR real real ';' + { + cfg->shearCameraOffset( $2, $3 ); + } + | PRTOKEN_ROTATE real real real real ';' + { + cfg->rotateCameraOffset( $2, $3, $4, $5 ); + } + | PRTOKEN_TRANSLATE real real real ';' + { + cfg->translateCameraOffset( $2, $3, $4 ); + } + | PRTOKEN_SCALE real real real ';' + { + cfg->scaleCameraOffset( $2, $3, $4 ); + } + | PRTOKEN_METHOD offset_multiply_method ';' + { + cfg->setCameraOffsetMultiplyMethod( (Producer::Camera::Offset::MultiplyMethod)$2 ); + } + ; offset_multiply_method: PRTOKEN_PREMULTIPLY { $$ = Producer::Camera::Offset::PreMultiply; } @@ -266,92 +266,92 @@ offset_multiply_method: ; lens : PRTOKEN_LENS '{' lens_attributes '}' - ; + ; lens_attributes : lens_attribute | lens_attributes lens_attribute - ; + ; lens_attribute : - /* Empty */ - | PRTOKEN_ORTHO real real real real real real ';' - { - cfg->setCameraOrtho( $2, $3, $4, $5, $6, $7 ); - } - | PRTOKEN_ORTHO real real real real real real real real ';' - { - cfg->setCameraOrtho( $2, $3, $4, $5, $6, $7, $8, $9 ); - } - | PRTOKEN_PERSPECTIVE real real real real ';' - { - cfg->setCameraPerspective( $2, $3, $4, $5 ); - } - | PRTOKEN_PERSPECTIVE real real real real real real ';' - { - cfg->setCameraPerspective( $2, $3, $4, $5, $6, $7 ); - } - | PRTOKEN_FRUSTUM real real real real real real ';' - { - cfg->setCameraFrustum( $2, $3, $4, $5, $6, $7 ); - } - | PRTOKEN_FRUSTUM real real real real real real real real ';' - { - cfg->setCameraFrustum( $2, $3, $4, $5, $6, $7, $8, $9 ); - } - | PRTOKEN_SHEAR real real ';' - { - cfg->setCameraLensShear( $2, $3 ); - } - ; + /* Empty */ + | PRTOKEN_ORTHO real real real real real real ';' + { + cfg->setCameraOrtho( $2, $3, $4, $5, $6, $7 ); + } + | PRTOKEN_ORTHO real real real real real real real real ';' + { + cfg->setCameraOrtho( $2, $3, $4, $5, $6, $7, $8, $9 ); + } + | PRTOKEN_PERSPECTIVE real real real real ';' + { + cfg->setCameraPerspective( $2, $3, $4, $5 ); + } + | PRTOKEN_PERSPECTIVE real real real real real real ';' + { + cfg->setCameraPerspective( $2, $3, $4, $5, $6, $7 ); + } + | PRTOKEN_FRUSTUM real real real real real real ';' + { + cfg->setCameraFrustum( $2, $3, $4, $5, $6, $7 ); + } + | PRTOKEN_FRUSTUM real real real real real real real real ';' + { + cfg->setCameraFrustum( $2, $3, $4, $5, $6, $7, $8, $9 ); + } + | PRTOKEN_SHEAR real real ';' + { + cfg->setCameraLensShear( $2, $3 ); + } + ; render_surface : PRTOKEN_RENDER_SURFACE name - { - cfg->beginRenderSurface( $2 ); - } - '{' render_surface_attributes '}' - { - cfg->endRenderSurface(); - } - ; + { + cfg->beginRenderSurface( $2 ); + } + '{' render_surface_attributes '}' + { + cfg->endRenderSurface(); + } + ; render_surface_attributes : render_surface_attribute | render_surface_attributes render_surface_attribute - ; + ; render_surface_attribute : - /* Empty */ - | PRTOKEN_VISUAL name ';' - { - cfg->setRenderSurfaceVisualChooser( $2 ); - } - | visual - { - cfg->setRenderSurfaceVisualChooser(); - } - | PRTOKEN_WINDOW_RECT intparam intparam intparam intparam ';' - { - cfg->setRenderSurfaceWindowRectangle( $2, $3, $4, $5 ); - } + /* Empty */ + | PRTOKEN_VISUAL name ';' + { + cfg->setRenderSurfaceVisualChooser( $2 ); + } + | visual + { + cfg->setRenderSurfaceVisualChooser(); + } + | PRTOKEN_WINDOW_RECT intparam intparam intparam intparam ';' + { + cfg->setRenderSurfaceWindowRectangle( $2, $3, $4, $5 ); + } | PRTOKEN_INPUT_RECT floatparam floatparam floatparam floatparam ';' { cfg->setRenderSurfaceInputRectangle( $2, $3, $4, $5 ); } - | PRTOKEN_HOSTNAME name ';' - { - cfg->setRenderSurfaceHostName( std::string($2) ); - } - | PRTOKEN_DISPLAY intparam ';' - { - cfg->setRenderSurfaceDisplayNum( $2 ); - } - | PRTOKEN_SCREEN intparam ';' - { - cfg->setRenderSurfaceScreen( $2 ); - } - | PRTOKEN_BORDER bool ';' - { - cfg->setRenderSurfaceBorder( $2 ); - } + | PRTOKEN_HOSTNAME name ';' + { + cfg->setRenderSurfaceHostName( std::string($2) ); + } + | PRTOKEN_DISPLAY intparam ';' + { + cfg->setRenderSurfaceDisplayNum( $2 ); + } + | PRTOKEN_SCREEN intparam ';' + { + cfg->setRenderSurfaceScreen( $2 ); + } + | PRTOKEN_BORDER bool ';' + { + cfg->setRenderSurfaceBorder( $2 ); + } | PRTOKEN_CUSTOM_FULL_SCREEN_RECTANGLE intparam intparam intparam intparam ';' { cfg->setRenderSurfaceCustomFullScreenRectangle( $2, $3, $4, $5 ); @@ -373,7 +373,7 @@ render_surface_attribute : { cfg->setRenderSurfaceRenderToTextureMode( (Producer::RenderSurface::RenderToTextureMode)$2 ); } - ; + ; drawableType: PRTOKEN_WINDOW_TYPE { $$ = RenderSurface::DrawableType_Window; } @@ -388,189 +388,189 @@ rtt_mode : visual : PRTOKEN_VISUAL name - { - cfg->beginVisual( $2 ); - } - '{' visual_attributes '}' - { - cfg->endVisual(); - } + { + cfg->beginVisual( $2 ); + } + '{' visual_attributes '}' + { + cfg->endVisual(); + } - | PRTOKEN_VISUAL - { - cfg->beginVisual(); - } - '{' visual_attributes '}' - { - cfg->endVisual(); - } - ; + | PRTOKEN_VISUAL + { + cfg->beginVisual(); + } + '{' visual_attributes '}' + { + cfg->endVisual(); + } + ; visual_attributes : visual_attribute | visual_attributes ',' visual_attribute - ; + ; visual_attribute : - PRTOKEN_SET_SIMPLE - { - cfg->setVisualSimpleConfiguration(); - } - | PRTOKEN_VISUAL_ID hex_integer - { - cfg->setVisualByID( $2 ); - } - - | PRTOKEN_BUFFER_SIZE intparam - { - cfg->addVisualAttribute( VisualChooser::BufferSize, $2 ); - } - | PRTOKEN_LEVEL intparam - { - cfg->addVisualAttribute( VisualChooser::Level, $2 ); - } - - | PRTOKEN_RGBA - { - cfg->addVisualAttribute( VisualChooser::RGBA ); - } - | PRTOKEN_DOUBLEBUFFER - { - cfg->addVisualAttribute( VisualChooser::DoubleBuffer ); - } - | PRTOKEN_STEREO - { - cfg->addVisualAttribute( VisualChooser::Stereo ); - } - | PRTOKEN_AUX_BUFFERS intparam - { - cfg->addVisualAttribute( VisualChooser::AuxBuffers, $2 ); - } - | PRTOKEN_RED_SIZE intparam - { - cfg->addVisualAttribute( VisualChooser::RedSize, $2 ); - } - - | PRTOKEN_GREEN_SIZE intparam - { - cfg->addVisualAttribute( VisualChooser::GreenSize, $2 ); - } - - | PRTOKEN_BLUE_SIZE intparam - { - cfg->addVisualAttribute( VisualChooser::BlueSize, $2 ); - } - | PRTOKEN_ALPHA_SIZE intparam - { - cfg->addVisualAttribute( VisualChooser::AlphaSize, $2 ); - } - | PRTOKEN_DEPTH_SIZE intparam - { - cfg->addVisualAttribute( VisualChooser::DepthSize, $2 ); - } - | PRTOKEN_STENCIL_SIZE intparam - { - cfg->addVisualAttribute( VisualChooser::StencilSize, $2 ); - } - | PRTOKEN_ACCUM_RED_SIZE intparam - { - cfg->addVisualAttribute( VisualChooser::AccumRedSize, $2 ); - } - | PRTOKEN_ACCUM_GREEN_SIZE intparam - { - cfg->addVisualAttribute( VisualChooser::AccumGreenSize, $2 ); - } - | PRTOKEN_ACCUM_BLUE_SIZE intparam - { - cfg->addVisualAttribute( VisualChooser::AccumBlueSize, $2 ); - } - | PRTOKEN_ACCUM_ALPHA_SIZE intparam - { - cfg->addVisualAttribute( VisualChooser::AccumAlphaSize, $2 ); - } - | PRTOKEN_SAMPLES intparam - { - cfg->addVisualAttribute( VisualChooser::Samples, $2 ); + PRTOKEN_SET_SIMPLE + { + cfg->setVisualSimpleConfiguration(); } - | PRTOKEN_SAMPLE_BUFFERS - { - cfg->addVisualAttribute( VisualChooser::SampleBuffers ); - } - | intparam intparam - { - cfg->addVisualExtendedAttribute( $1, $2 ); - } - ; + | PRTOKEN_VISUAL_ID hex_integer + { + cfg->setVisualByID( $2 ); + } + + | PRTOKEN_BUFFER_SIZE intparam + { + cfg->addVisualAttribute( VisualChooser::BufferSize, $2 ); + } + | PRTOKEN_LEVEL intparam + { + cfg->addVisualAttribute( VisualChooser::Level, $2 ); + } + + | PRTOKEN_RGBA + { + cfg->addVisualAttribute( VisualChooser::RGBA ); + } + | PRTOKEN_DOUBLEBUFFER + { + cfg->addVisualAttribute( VisualChooser::DoubleBuffer ); + } + | PRTOKEN_STEREO + { + cfg->addVisualAttribute( VisualChooser::Stereo ); + } + | PRTOKEN_AUX_BUFFERS intparam + { + cfg->addVisualAttribute( VisualChooser::AuxBuffers, $2 ); + } + | PRTOKEN_RED_SIZE intparam + { + cfg->addVisualAttribute( VisualChooser::RedSize, $2 ); + } + + | PRTOKEN_GREEN_SIZE intparam + { + cfg->addVisualAttribute( VisualChooser::GreenSize, $2 ); + } + + | PRTOKEN_BLUE_SIZE intparam + { + cfg->addVisualAttribute( VisualChooser::BlueSize, $2 ); + } + | PRTOKEN_ALPHA_SIZE intparam + { + cfg->addVisualAttribute( VisualChooser::AlphaSize, $2 ); + } + | PRTOKEN_DEPTH_SIZE intparam + { + cfg->addVisualAttribute( VisualChooser::DepthSize, $2 ); + } + | PRTOKEN_STENCIL_SIZE intparam + { + cfg->addVisualAttribute( VisualChooser::StencilSize, $2 ); + } + | PRTOKEN_ACCUM_RED_SIZE intparam + { + cfg->addVisualAttribute( VisualChooser::AccumRedSize, $2 ); + } + | PRTOKEN_ACCUM_GREEN_SIZE intparam + { + cfg->addVisualAttribute( VisualChooser::AccumGreenSize, $2 ); + } + | PRTOKEN_ACCUM_BLUE_SIZE intparam + { + cfg->addVisualAttribute( VisualChooser::AccumBlueSize, $2 ); + } + | PRTOKEN_ACCUM_ALPHA_SIZE intparam + { + cfg->addVisualAttribute( VisualChooser::AccumAlphaSize, $2 ); + } + | PRTOKEN_SAMPLES intparam + { + cfg->addVisualAttribute( VisualChooser::Samples, $2 ); + } + | PRTOKEN_SAMPLE_BUFFERS + { + cfg->addVisualAttribute( VisualChooser::SampleBuffers ); + } + | intparam intparam + { + cfg->addVisualExtendedAttribute( $1, $2 ); + } + ; input_area : PRTOKEN_INPUT_AREA - { cfg->beginInputArea(); } - '{' input_area_entries '}' - { cfg->endInputArea(); } - ; + { cfg->beginInputArea(); } + '{' input_area_entries '}' + { cfg->endInputArea(); } + ; input_area_entries : input_area_entry | input_area_entries input_area_entry - ; + ; input_area_entry : - PRTOKEN_RENDER_SURFACE name ';' - { - cfg->addInputAreaEntry( $2 ); - } - ; + PRTOKEN_RENDER_SURFACE name ';' + { + cfg->addInputAreaEntry( $2 ); + } + ; real : PRTOKEN_FLOAT - { - $$ = atof(flexer->YYText()); - } - | PRTOKEN_INTEGER - { - $$ = atof(flexer->YYText()); - } - ; + { + $$ = atof(flexer->YYText()); + } + | PRTOKEN_INTEGER + { + $$ = atof(flexer->YYText()); + } + ; floatparam : PRTOKEN_FLOAT - { - $$ = atof(flexer->YYText()); - } - ; + { + $$ = atof(flexer->YYText()); + } + ; intparam : PRTOKEN_INTEGER - { - $$ = atoi( flexer->YYText() ); - } - ; + { + $$ = atoi( flexer->YYText() ); + } + ; name : PRTOKEN_QUOTED_STRING - { - $$ = strdup( flexer->YYText() ); - } - ; + { + $$ = strdup( flexer->YYText() ); + } + ; string : PRTOKEN_QUOTED_STRING - { - $$ = strdup( flexer->YYText() ); - } - ; + { + $$ = strdup( flexer->YYText() ); + } + ; hex_integer : PRTOKEN_HEX_INTEGER - { - int n; - sscanf( flexer->YYText(), "0x%x", &n ); - $$ = n; - } - ; + { + int n; + sscanf( flexer->YYText(), "0x%x", &n ); + $$ = n; + } + ; bool : PRTOKEN_TRUE { $$ = true;} | PRTOKEN_FALSE { $$ = false; } - ; + ; %% static void yyerror( const char *errmsg ) { fprintf( stderr, - "CameraConfig::parseFile(\"%s\") : %s - Line %d at or before \"%s\"\n", - fileName.c_str(), - errmsg, + "CameraConfig::parseFile(\"%s\") : %s - Line %d at or before \"%s\"\n", + fileName.c_str(), + errmsg, flexer->lineno(), flexer->YYText() ); }