Buffeted by continuing economic reverses, Portuguese Premier Mario Soares appears to have run out of the room for maneuver that has kept his minority Socialist government in power for a year and a half.

Soares, pugnacious and sociable, has been able up to now to get legislation through Parliament by shifting deftly to his right or left, drawing temporary support from Social Democrats. Christian Democrats of Communists.

The balancing act faces its most severe test on Wednesday when Soares has said he will call for a confidence vote for his minority government and for its austerity program that is designed to try to pull the country out of the economic doldrums.

The vote is expected by the end of the week and its outcome could go far to determine the future of Portugal's 2 1/2-year experiment with democratic rule.

Faced with virulent and entrenched critics on bothe political extremes, Soares has fought for the last year and a half to prevent a political polarization.

With 102 seats in the Legislative Assembly, Soares' Socialists have most often drawn support from the Social Democrats and Christian Democrats to his right. Now, they appear ready to abandon this practice, forcing Soares to depend only on the Communists if he is to survive. Such a step could have the impact of removing Soares from a political middle ground.

Stree violence and a bomb explosion today were the first signs of the poss Political violence that wracked Portugal in the days following the overthrow of the Salazar dictatorship in 1974.

The violence erupted when leftist youths clashed with rightists marching through Lisbon during a celebration marking the anniversary of Portugal's independence from Spain in 1640. A bomb exploded outside Communist Party headquarters.

Communist leader Alvaro Cunhal, with 40 seats in Parliament, has said he will not know how his party will vote until the last minute.

In any event, Soares has announced that he has no intention of forming a coalition with either the right or the left and that he hopes to avoid a "polarization of the extremes."

After a year of strikes and political violence - much of it stemming from growing dissatisfaction with the flagging economy - Soares brought the situation to a head last week by challenging Parliament to decide whether it wants him to stay on, and accept his economic austerity plan, or kick his government out of power.

The political drama is set against a bleak economic background. Portugal has tried to revive its sagging industry this year by importing large quantities of machinery and raw materials.

The main result, so far, has been a huge increase in the balance of payments deficit. At the same time, the country's agricultural output is down sharply as a result of persistent bad weather and clashes between private farmers and Communist-backed collective farmers. This has meant added costs from food imports that have swelled the trade deficit ot $1.9 billion. Only tourism and money sent home by Portuguese abroad have kept the balance of payments deficit down to $1.1 billion.

Under pressure from the International Monetary Fund to cut this deficit to $800 million in 1978, Soares want a sharp cutback in services, higher taxes and temporary cutbacks in imports. All are bitter political pills, leading to the current test of Soares' future.